Make production listener configurable

This commit is contained in:
2026-07-23 13:47:39 -07:00
parent bd5538e778
commit 208e2153e3
2 changed files with 10 additions and 3 deletions
+8 -3
View File
@@ -12,7 +12,12 @@ const execAsync = promisify(exec);
async function startServer() {
const app = express();
const PORT = 3000;
const port = Number.parseInt(process.env.PORT ?? "3000", 10);
const host = process.env.HOST ?? "0.0.0.0";
if (!Number.isInteger(port) || port < 1 || port > 65535) {
throw new Error(`Invalid PORT value: ${process.env.PORT}`);
}
app.use(express.json());
@@ -756,8 +761,8 @@ async function startServer() {
});
}
app.listen(PORT, "0.0.0.0", () => {
console.log(`Labyricorn Control Plane running on http://0.0.0.0:${PORT}`);
app.listen(port, host, () => {
console.log(`Labyricorn Control Plane running on http://${host}:${port}`);
});
}