Update Server

- Move socket server start to main server file
- This way tests and the main function can use the same code
This commit is contained in:
Logan Cusano
2024-04-07 16:58:50 -04:00
parent 49ae941e83
commit 0ce0f72ed3
2 changed files with 5 additions and 5 deletions

View File

@@ -30,9 +30,4 @@ nodeIo.on('connection', (socket) => {
nodeDisconnectWrapper(socket.id); nodeDisconnectWrapper(socket.id);
}); });
});
// Startup the node server
server.listen(3000, () => {
console.log('server running at http://localhost:3000');
}); });

View File

@@ -5,6 +5,11 @@ import { serverClient, addEnabledEventListeners } from './discordBot/discordBot.
import dotenv from 'dotenv'; import dotenv from 'dotenv';
dotenv.config() dotenv.config()
// Startup the node server
server.listen(process.env.SERVER_PORT || 3000, () => {
console.log(`server running at http://localhost:${process.env.SERVER_PORT}`);
});
// Add objects to the others // Add objects to the others
serverClient.nodeIo = nodeIo; serverClient.nodeIo = nodeIo;
nodeIo.serverClient = serverClient; nodeIo.serverClient = serverClient;