修改默认绑定 HOST #620

This commit is contained in:
binaryify
2019-10-28 11:17:38 +08:00
parent 641a72b06c
commit 5951985e4c
4 changed files with 9 additions and 6 deletions
+2 -2
View File
@@ -83,10 +83,10 @@ fs.readdirSync(path.join(__dirname, 'module')).reverse().forEach(file => {
})
const port = process.env.PORT || 3000
const host = process.env.HOST || '127.0.0.1'
const host = process.env.HOST || ''
app.server = app.listen(port, host, () => {
console.log(`server running @ http://${host}:${port}`)
console.log(`server running @ http://${host ? host : 'localhost'}:${port}`)
})
module.exports = app