2026-03-13 23:21:55 +00:00
|
|
|
import app from "./app";
|
|
|
|
|
|
|
|
|
|
const rawPort = process.env["PORT"];
|
|
|
|
|
|
|
|
|
|
if (!rawPort) {
|
|
|
|
|
throw new Error(
|
|
|
|
|
"PORT environment variable is required but was not provided.",
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const port = Number(rawPort);
|
|
|
|
|
|
|
|
|
|
if (Number.isNaN(port) || port <= 0) {
|
|
|
|
|
throw new Error(`Invalid PORT value: "${rawPort}"`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.listen(port, () => {
|
|
|
|
|
console.log(`Server listening on port ${port}`);
|
2026-03-18 21:02:06 +00:00
|
|
|
const domain = process.env["REPLIT_DEV_DOMAIN"];
|
|
|
|
|
if (domain) {
|
|
|
|
|
console.log(`Public UI: https://${domain}/api/ui`);
|
|
|
|
|
}
|
2026-03-13 23:21:55 +00:00
|
|
|
});
|