Created
May 30, 2021 08:13
-
-
Save hoangsetup/394af8128d3ad354740b4daa5f20cfc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/app.ts b/src/app.ts | |
index 60fe0f7..3d64562 100644 | |
--- a/src/app.ts | |
+++ b/src/app.ts | |
@@ -1,5 +1,6 @@ | |
import express from 'express'; | |
import pm2Lib from './pm2Lib'; | |
+import socketIO from './socketIO'; | |
const app = express(); | |
@@ -38,6 +39,8 @@ app.put('/miners/:filename/:action(start|restart|stop)', async (req, res) => { | |
const PORT = process.env.PORT || 3000; | |
-app.listen(PORT, () => { | |
+const httpServer = app.listen(PORT, () => { | |
console.log(`[Server] Listening on :${PORT}`); | |
}); | |
+ | |
+socketIO.init(httpServer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment