14 lines
362 B
JavaScript
14 lines
362 B
JavaScript
import { spawn } from "node:child_process";
|
|
|
|
import { getEnginePath } from "@rivetkit/engine-cli";
|
|
|
|
const enginePath = getEnginePath();
|
|
const proc = spawn(enginePath, ["start"], { stdio: "inherit" });
|
|
|
|
process.on("SIGINT", () => proc.kill("SIGINT"));
|
|
process.on("SIGTERM", () => proc.kill("SIGTERM"));
|
|
|
|
proc.on("exit", (code) => {
|
|
process.exit(code ?? 0);
|
|
});
|