Update v1.1.1-beta1
This commit is contained in:
10
server.js
10
server.js
@@ -37,8 +37,9 @@ const loadSetup = async () => {
|
||||
};
|
||||
|
||||
// Configuration de l'application
|
||||
const configureApp = async () => {
|
||||
const configureApp = async () => {
|
||||
const setup = await loadSetup();
|
||||
const WebSocketManager = require('./models/websocketManager.js');
|
||||
|
||||
// Configuration des stratégies d'authentification
|
||||
if (setup.discord) require('./models/Passport-Discord.js');
|
||||
@@ -90,7 +91,7 @@ const configureApp = async () => {
|
||||
app.use((err, req, res, next) => {
|
||||
ErrorLogger.error('Unhandled error:', err);
|
||||
|
||||
res.status(500).json(response);
|
||||
res.status(500).json({ error: 'Internal Server Error', message: err.message });
|
||||
});
|
||||
};
|
||||
|
||||
@@ -140,6 +141,11 @@ const startServer = () => {
|
||||
}
|
||||
});
|
||||
|
||||
// Initialiser le WebSocket Manager ici, après la création du serveur
|
||||
const WebSocketManager = require('./models/websocketManager.js');
|
||||
const wsManager = new WebSocketManager(server);
|
||||
app.set('wsManager', wsManager);
|
||||
|
||||
return server;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user