modified: src/backend/server.js
This commit is contained in:
parent
18a1b46708
commit
f78681f3aa
1 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ const path = require('path');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const httpServer = http.createServer(app);
|
const httpServer = http.createServer(app);
|
||||||
const PORT = 3000;
|
const PORT = process.env.PORT || 3000;
|
||||||
|
|
||||||
// Trust proxy for Codespaces/containers
|
// Trust proxy for Codespaces/containers
|
||||||
app.set('trust proxy', 1);
|
app.set('trust proxy', 1);
|
||||||
|
|
@ -23,7 +23,7 @@ app.set('trust proxy', 1);
|
||||||
// Security middleware
|
// Security middleware
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
app.use(cors({
|
app.use(cors({
|
||||||
origin: process.env.FRONTEND_URL || 'http://localhost:5173',
|
origin: process.env.FRONTEND_URL || 'https://atx-connect.up.railway.app',
|
||||||
credentials: true
|
credentials: true
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
@ -80,8 +80,8 @@ app.use((err, req, res, next) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start server
|
// Start server - bind to 0.0.0.0 for Railway/containers
|
||||||
httpServer.listen(PORT, () => {
|
httpServer.listen(PORT, '0.0.0.0', () => {
|
||||||
console.log(`
|
console.log(`
|
||||||
╔═══════════════════════════════════════════════════════╗
|
╔═══════════════════════════════════════════════════════╗
|
||||||
║ AeThex Connect - Communication Platform ║
|
║ AeThex Connect - Communication Platform ║
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue