Files
robertseares/frontend/start-standalone.mjs
a2a-platform 7aab2dccb9 deploy
2026-06-11 23:13:20 +00:00

24 lines
583 B
JavaScript

import { spawnSync } from "node:child_process";
import { existsSync } from "node:fs";
const candidates = [
".next/standalone/server.js",
".next/standalone/frontend/server.js",
];
const server = candidates.find((path) => existsSync(path));
if (!server) {
throw new Error("Next standalone server.js not found; run npm run build first");
}
const result = spawnSync(process.execPath, [server], {
stdio: "inherit",
env: {
...process.env,
HOSTNAME: process.env.HOSTNAME || "127.0.0.1",
PORT: process.env.PORT || "3000",
},
});
process.exit(result.status ?? 1);