Skip to main content


Alosaur - Deno web framework with many decorators
Go to Latest
import { assert, BufReader, TextProtoReader } from "../src/deps_test.ts";
export async function startServer(serverPath: string): Promise<Deno.Process> { let process: Deno.Process;
process ={ cmd: [ Deno.execPath(), "run", "-A", "--importmap=imports.json", "--unstable", "--config", "./src/tsconfig.lib.json", serverPath, ], stdout: "piped", stderr: "inherit", }); // Once server is ready it will write to its stdout. assert(process.stdout != null);
const r = new TextProtoReader(new BufReader(process.stdout as any)); let s = await r.readLine();
// assert(s !== null && s.includes("Server start in")); assert(s !== null);
return Promise.resolve(process);}
export function killServer(process: Deno.Process): void { process.close(); (process.stdout as any)?.close();}
export function itLog(s: string, firstIt = false): void { firstIt ? console.log("\n" + s) : console.log(s);}