Fix: bind to 0.0.0.0 for external access (backend + frontend)

This commit is contained in:
salvacybersec
2025-11-11 05:25:10 +03:00
parent 8e4b86de61
commit 186d32ad79
2 changed files with 7 additions and 7 deletions

View File

@@ -153,14 +153,14 @@ const startServer = async () => {
// Test database connection
await testConnection();
// Start listening
app.listen(PORT, () => {
// Start listening on all interfaces (0.0.0.0)
app.listen(PORT, '0.0.0.0', () => {
logger.info(`🚀 Server is running on port ${PORT}`);
logger.info(`📊 Environment: ${process.env.NODE_ENV || 'development'}`);
logger.info(`🔗 Health check: http://localhost:${PORT}/health`);
logger.info(`🔗 Health check: http://0.0.0.0:${PORT}/health`);
console.log(`\n✨ Oltalama Backend Server Started!`);
console.log(`🌐 API: http://localhost:${PORT}/api`);
console.log(`🎯 Tracking: http://localhost:${PORT}/t/:token\n`);
console.log(`🌐 API: http://0.0.0.0:${PORT}/api`);
console.log(`🎯 Tracking: http://0.0.0.0:${PORT}/t/:token\n`);
});
} catch (error) {
logger.error('Failed to start server:', error);