diff --git a/Build/server.js b/Build/server.js index 8d5b5aa..022657e 100644 --- a/Build/server.js +++ b/Build/server.js @@ -3,6 +3,7 @@ const fs = require('fs'); const path = require('path'); const PORT = process.env.PORT || 24710; +const HOST = process.env.HOST || '0.0.0.0'; const ROOT = __dirname; const MIME = { @@ -150,12 +151,12 @@ function serveStatic(req, res) { http.createServer((req, res) => { if (req.url === '/' || req.url === '/index.html') return serveIndex(res); serveStatic(req, res); -}).listen(PORT, () => { +}).listen(PORT, HOST, () => { console.log(''); console.log(' ╔══════════════════════════════════════════════════╗'); console.log(' ║ 运动伤害现场急救虚拟仿真实验 - WebGL Server ║'); console.log(' ║ ║'); - console.log(' ║ Server running at: http://localhost:' + PORT + ' ║'); + console.log(' ║ Server running at: http://' + HOST + ':' + PORT + ' ║'); console.log(' ║ Press Ctrl+C to stop ║'); console.log(' ╚══════════════════════════════════════════════════╝'); console.log('');