Update server configuration to include HOST variable and enhance server start log message

This commit is contained in:
Mauricio Siu 2025-04-26 17:05:21 -06:00
parent 6518407c0c
commit 33de620893

View File

@ -21,6 +21,7 @@ import { setupTerminalWebSocketServer } from "./wss/terminal";
config({ path: ".env" });
const PORT = Number.parseInt(process.env.PORT || "3000", 10);
const HOST = process.env.HOST || "0.0.0.0";
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev, turbopack: process.env.TURBOPACK === "1" });
const handle = app.getRequestHandler();
@ -55,8 +56,8 @@ void app.prepare().then(async () => {
await migration();
}
server.listen(PORT);
console.log("Server Started:", PORT);
server.listen(PORT, HOST);
console.log(`Server Started on: http://${HOST}:${PORT}`);
if (!IS_CLOUD) {
console.log("Starting Deployment Worker");
const { deploymentWorker } = await import("./queues/deployments-queue");