Merge pull request #613 from 52871299hzy/master

Added customizable host.
This commit is contained in:
binaryify 2019-10-23 22:52:35 +08:00 committed by GitHub
commit 8bde78595b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
app.js
View 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