From 47de5ac65bb019d93000af814ab72c65685d8b03 Mon Sep 17 00:00:00 2001 From: CN-JS-HuiBai Date: Thu, 2 Apr 2026 17:35:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87ENV=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 1 + server.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 1f93d06..eec111a 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ PORT=3000 +HOST=0.0.0.0 # AWS S3 / MinIO Configuration AWS_REGION=us-east-1 diff --git a/server.js b/server.js index 6656a1e..d242a66 100644 --- a/server.js +++ b/server.js @@ -10,6 +10,7 @@ dotenv.config(); const app = express(); const PORT = process.env.PORT || 3000; +const HOST = process.env.HOST || process.env.LISTEN_ADDRESS || '0.0.0.0'; app.use(cors()); app.use(express.json()); @@ -145,6 +146,6 @@ app.get('/api/status', (req, res) => { } }); -app.listen(PORT, () => { - console.log(`Server running on http://localhost:${PORT}`); +app.listen(PORT, HOST, () => { + console.log(`Server running on http://${HOST}:${PORT}`); });