Fix: bind to 0.0.0.0 for external access (backend + frontend)
This commit is contained in:
@@ -153,14 +153,14 @@ const startServer = async () => {
|
|||||||
// Test database connection
|
// Test database connection
|
||||||
await testConnection();
|
await testConnection();
|
||||||
|
|
||||||
// Start listening
|
// Start listening on all interfaces (0.0.0.0)
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, '0.0.0.0', () => {
|
||||||
logger.info(`🚀 Server is running on port ${PORT}`);
|
logger.info(`🚀 Server is running on port ${PORT}`);
|
||||||
logger.info(`📊 Environment: ${process.env.NODE_ENV || 'development'}`);
|
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(`\n✨ Oltalama Backend Server Started!`);
|
||||||
console.log(`🌐 API: http://localhost:${PORT}/api`);
|
console.log(`🌐 API: http://0.0.0.0:${PORT}/api`);
|
||||||
console.log(`🎯 Tracking: http://localhost:${PORT}/t/:token\n`);
|
console.log(`🎯 Tracking: http://0.0.0.0:${PORT}/t/:token\n`);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Failed to start server:', error);
|
logger.error('Failed to start server:', error);
|
||||||
|
|||||||
@@ -435,8 +435,8 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
name: 'oltalama-frontend',
|
name: 'oltalama-frontend',
|
||||||
cwd: '/opt/oltalama/frontend',
|
cwd: '/opt/oltalama/frontend',
|
||||||
script: 'npm',
|
script: 'node_modules/.bin/vite',
|
||||||
args: 'run preview',
|
args: 'preview --host 0.0.0.0 --port 4173',
|
||||||
instances: 1,
|
instances: 1,
|
||||||
exec_mode: 'fork',
|
exec_mode: 'fork',
|
||||||
watch: false,
|
watch: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user