From 49dbd7f619eec9b05d8c44bccaf88711fcff6cea Mon Sep 17 00:00:00 2001 From: tim Date: Sat, 26 Apr 2025 17:50:05 -0400 Subject: [PATCH] DEXORDER_BIND --- .env-mock | 1 + main.js | 13 ++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.env-mock b/.env-mock index 4e7d01f..fb7a407 100644 --- a/.env-mock +++ b/.env-mock @@ -1,3 +1,4 @@ +#DEXORDER_BIND=0.0.0.0 DEXORDER_PORT=3001 DEXORDER_APP_URL=http://localhost:3000 diff --git a/main.js b/main.js index 97851d9..3aa21cd 100644 --- a/main.js +++ b/main.js @@ -3,15 +3,10 @@ import {httpServer} from "./io.js"; import {initIO} from "./route.js"; -// setup socket.io - initIO(); -// io.on("disconnection", (socket)=>{ -// socket.leave('public') // todo isn't this automatic? -// todo unsub pools etc? -// }) - const port = parseInt(process.env.DEXORDER_PORT) || 3001; -httpServer.listen(port) -console.log('Started server on port '+port) +const bind = process.env.DEXORDER_BIND || 'localhost'; +httpServer.listen(port, bind, ()=>{ + console.log(`Started server on ${bind}:${port}`) +})