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:
@@ -30,9 +30,4 @@ nodeIo.on('connection', (socket) => {
|
||||
nodeDisconnectWrapper(socket.id);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Startup the node server
|
||||
server.listen(3000, () => {
|
||||
console.log('server running at http://localhost:3000');
|
||||
});
|
||||
@@ -5,6 +5,11 @@ import { serverClient, addEnabledEventListeners } from './discordBot/discordBot.
|
||||
import dotenv from 'dotenv';
|
||||
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
|
||||
serverClient.nodeIo = nodeIo;
|
||||
nodeIo.serverClient = serverClient;
|
||||
|
||||
Reference in New Issue
Block a user