Skip to content

Commit 4bace86

Browse files
author
khanh2906
committed
update
1 parent 2c16697 commit 4bace86

File tree

5 files changed

+3
-22
lines changed

5 files changed

+3
-22
lines changed

lib/stubs/template/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ APP_CLUSTER_NUMBER=1
88
APP_ASSET=http://localhost:3000
99
APP_URL=http://localhost:3000
1010
# UV_THREADPOOL_SIZE=6
11-
SOCKET_APP_PORT=3001
11+
USE_SOCKET=false
1212

1313

1414
# Auth

lib/stubs/template/src/bootstrap/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobOnMain();
8686
* Socket run on main process
8787
* **********************************
8888
*/
89-
if (configs.socket.onMain) {
89+
if (configs.socket.use) {
9090
socket.io(server, configs.socket);
9191
require("@iRoutes/socket")
9292
}

lib/stubs/template/src/bootstrap/socket.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

lib/stubs/template/src/configs/socket.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,5 @@ module.exports = {
88
transports: ["websocket", "polling"],
99
},
1010
transports: ["websocket", "polling"],
11-
server: {
12-
host: process.env.SOCKET_APP_HOST || "localhost",
13-
port: process.env.SOCKET_APP_PORT || process.env.PORT || 3001,
14-
},
15-
onMain: false
11+
use: process.env.USE_SOCKET == "true" ? true : false
1612
};

lib/stubs/template/src/socket.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)