Fix jwt-token

This commit is contained in:
2025-08-17 05:25:15 +02:00
parent 22d52b84b5
commit ce87df0eb5
4 changed files with 172 additions and 31 deletions

View File

@@ -11,6 +11,7 @@ require('dotenv').config();
const { sequelize } = require('./models');
const routes = require('./routes');
const { initializeSocketHandlers } = require('./services/socketService');
const AlertService = require('./services/alertService');
const errorHandler = require('./middleware/errorHandler');
const app = express();
@@ -81,8 +82,24 @@ async function startServer() {
}
server.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
console.log(`Environment: ${process.env.NODE_ENV}`);
console.log('\n🚀 Drone Detection System Started Successfully!');
console.log('================================================');
console.log(`📊 Environment: ${process.env.NODE_ENV || 'development'}`);
console.log(`🌐 Server Port: ${PORT}`);
console.log(`💾 Database: ${process.env.DB_HOST}:${process.env.DB_PORT}`);
console.log(`🔴 Redis: ${process.env.REDIS_HOST || 'localhost'}:${process.env.REDIS_PORT || 6379}`);
// Initialize AlertService to check SMS status
const alertService = new AlertService();
if (alertService.twilioEnabled) {
console.log('📱 SMS Alerts: ✅ Enabled');
} else {
console.log('📱 SMS Alerts: ⚠️ Disabled (no Twilio credentials)');
}
console.log(`📊 Health check: http://localhost:${PORT}/health`);
console.log(`🌐 API endpoint: http://localhost:${PORT}/api`);
console.log('================================================\n');
});
} catch (error) {
console.error('Unable to start server:', error);