modified: src/backend/server.js

This commit is contained in:
Anderson 2026-02-05 21:05:28 +00:00 committed by GitHub
parent 18a1b46708
commit f78681f3aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,7 @@ const path = require('path');
const app = express();
const httpServer = http.createServer(app);
const PORT = 3000;
const PORT = process.env.PORT || 3000;
// Trust proxy for Codespaces/containers
app.set('trust proxy', 1);
@ -23,7 +23,7 @@ app.set('trust proxy', 1);
// Security middleware
app.use(helmet());
app.use(cors({
origin: process.env.FRONTEND_URL || 'http://localhost:5173',
origin: process.env.FRONTEND_URL || 'https://atx-connect.up.railway.app',
credentials: true
}));
@ -80,8 +80,8 @@ app.use((err, req, res, next) => {
});
});
// Start server
httpServer.listen(PORT, () => {
// Start server - bind to 0.0.0.0 for Railway/containers
httpServer.listen(PORT, '0.0.0.0', () => {
console.log(`
AeThex Connect - Communication Platform