feat(integration): WS bridge + Tower + payment panel + E2E test [10/10 PASS] (#26)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import app from "./app";
|
||||
import { createServer } from "http";
|
||||
import app from "./app.js";
|
||||
import { attachWebSocketServer } from "./routes/events.js";
|
||||
import { rootLogger } from "./lib/logger.js";
|
||||
|
||||
const rawPort = process.env["PORT"];
|
||||
|
||||
if (!rawPort) {
|
||||
throw new Error(
|
||||
"PORT environment variable is required but was not provided.",
|
||||
);
|
||||
throw new Error("PORT environment variable is required but was not provided.");
|
||||
}
|
||||
|
||||
const port = Number(rawPort);
|
||||
@@ -15,10 +15,15 @@ if (Number.isNaN(port) || port <= 0) {
|
||||
throw new Error(`Invalid PORT value: "${rawPort}"`);
|
||||
}
|
||||
|
||||
app.listen(port, () => {
|
||||
const server = createServer(app);
|
||||
attachWebSocketServer(server);
|
||||
|
||||
server.listen(port, () => {
|
||||
rootLogger.info("server started", { port });
|
||||
const domain = process.env["REPLIT_DEV_DOMAIN"];
|
||||
if (domain) {
|
||||
rootLogger.info("public url", { url: `https://${domain}/api/ui` });
|
||||
rootLogger.info("tower url", { url: `https://${domain}/tower` });
|
||||
rootLogger.info("ws url", { url: `wss://${domain}/api/ws` });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user