提交 9bf9ddd1 编写于 作者: B Bob

Added customizable host.

Use 'HOST=0.0.0.0 node app.js' to listen on all ip's.
上级 c0ff65b8
...@@ -83,9 +83,10 @@ fs.readdirSync(path.join(__dirname, 'module')).reverse().forEach(file => { ...@@ -83,9 +83,10 @@ fs.readdirSync(path.join(__dirname, 'module')).reverse().forEach(file => {
}) })
const port = process.env.PORT || 3000 const port = process.env.PORT || 3000
const host = process.env.HOST || 'localhost'
app.server = app.listen(port, () => { app.server = app.listen(port, host, () => {
console.log(`server running @ http://localhost:${port}`) console.log(`server running @ http://${host}:${port}`)
}) })
module.exports = app module.exports = app
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册