This commit is contained in:
dank074
2025-05-06 19:38:09 -05:00
parent 623f8fcebc
commit 5bae44faf0
4 changed files with 82 additions and 56 deletions
+6 -1
View File
@@ -31,13 +31,18 @@ import { Config, initDatabase, Sentry } from "@spacebar/util";
const app = express();
const server = http.createServer();
const port = Number(process.env.PORT) || 3001;
const wrtcWsPort = Number(process.env.WRTC_WS_PORT) || 3004;
const production = process.env.NODE_ENV == "development" ? false : true;
server.on("request", app);
const api = new Api.SpacebarServer({ server, port, production, app });
const cdn = new CDNServer({ server, port, production, app });
const gateway = new Gateway.Server({ server, port, production });
const webrtc = new Webrtc.Server({ server: undefined, port: 3004, production });
const webrtc = new Webrtc.Server({
server: undefined,
port: wrtcWsPort,
production,
});
process.on("SIGTERM", async () => {
console.log("Shutting down due to SIGTERM");