Fix jwt-token
This commit is contained in:
@@ -90,6 +90,16 @@ app.use('/api/', limiter);
|
||||
const ipRestriction = new IPRestrictionMiddleware();
|
||||
app.use((req, res, next) => ipRestriction.checkIPRestriction(req, res, next));
|
||||
|
||||
// Tenant-specific API rate limiting (for authenticated endpoints)
|
||||
const { enforceApiRateLimit } = require('./middleware/tenant-limits');
|
||||
app.use('/api', (req, res, next) => {
|
||||
// Apply tenant rate limiting only to authenticated API endpoints
|
||||
if (req.headers.authorization) {
|
||||
return enforceApiRateLimit()(req, res, next);
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
// Make io available to routes
|
||||
app.use((req, res, next) => {
|
||||
req.io = io;
|
||||
@@ -125,7 +135,11 @@ app.use(errorHandler);
|
||||
// Socket.IO initialization
|
||||
initializeSocketHandlers(io);
|
||||
|
||||
const PORT = process.env.PORT || 3001;
|
||||
// Initialize services
|
||||
const dataRetentionService = require('./services/data-retention');
|
||||
console.log('✅ Data retention service initialized');
|
||||
|
||||
const PORT = process.env.PORT || 5000;
|
||||
|
||||
// Migration runner
|
||||
const runMigrations = async () => {
|
||||
|
||||
Reference in New Issue
Block a user