Load .env via dotenv; default port to 33033

This commit is contained in:
2026-06-17 22:23:57 +10:00
parent 010558d104
commit 2c71a6bd39
+2 -1
View File
@@ -1,3 +1,4 @@
import 'dotenv/config';
import express from 'express'; import express from 'express';
import cookieParser from 'cookie-parser'; import cookieParser from 'cookie-parser';
import { dirname, join } from 'node:path'; import { dirname, join } from 'node:path';
@@ -9,7 +10,7 @@ import adminRoutes from './routes/admin.js';
const __dirname = dirname(fileURLToPath(import.meta.url)); const __dirname = dirname(fileURLToPath(import.meta.url));
const app = express(); const app = express();
const PORT = process.env.PORT || 3000; const PORT = process.env.PORT || 33033;
// nginx terminates HTTPS in front of this app; trust its X-Forwarded-* headers // nginx terminates HTTPS in front of this app; trust its X-Forwarded-* headers
// so secure cookies and req.protocol behave correctly. // so secure cookies and req.protocol behave correctly.