feat: prebundle code + restore from snapshot (#1604)
This commit is contained in:
+5
-3
@@ -15,13 +15,13 @@ export function parseHtml(input: string) {
|
||||
}
|
||||
|
||||
export async function startFreshServer(options: Deno.CommandOptions) {
|
||||
const { serverProcess, lines, address } = await spawnServer(options);
|
||||
const { serverProcess, lines, address, output } = await spawnServer(options);
|
||||
|
||||
if (!address) {
|
||||
throw new Error("Server didn't start up");
|
||||
}
|
||||
|
||||
return { serverProcess, lines, address };
|
||||
return { serverProcess, lines, address, output };
|
||||
}
|
||||
|
||||
export async function fetchHtml(url: string) {
|
||||
@@ -259,8 +259,10 @@ async function spawnServer(
|
||||
preventCancel: true,
|
||||
});
|
||||
|
||||
const output: string[] = [];
|
||||
let address = "";
|
||||
for await (const line of lines) {
|
||||
output.push(line);
|
||||
const match = line.match(/https?:\/\/localhost:\d+/g);
|
||||
if (match) {
|
||||
address = match[0];
|
||||
@@ -268,5 +270,5 @@ async function spawnServer(
|
||||
}
|
||||
}
|
||||
|
||||
return { serverProcess, lines, address };
|
||||
return { serverProcess, lines, address, output };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user