import { startServer } from "./server.ts";

async function main() {
    const server = startServer("localhost", 6969);

    const chromiumCmd = new Deno.Command("chromium", {
        args: [
            "--headless",
            "--print-to-pdf=./cv.pdf",
            "--no-pdf-header-footer",
            "http://localhost:6969/cv.html"
        ]
    })

    const process = chromiumCmd.spawn()
    await process.status

    await server.shutdown()
}

if (import.meta.main) {
    await main();
}
