Skip to content

Commit

Permalink
Merge pull request Binaryify#613 from 52871299hzy/master
Browse files Browse the repository at this point in the history
Added customizable host.
  • Loading branch information
Binaryify authored Oct 23, 2019
2 parents c0ff65b + 9bf9ddd commit 8bde785
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ fs.readdirSync(path.join(__dirname, 'module')).reverse().forEach(file => {
})

const port = process.env.PORT || 3000
const host = process.env.HOST || 'localhost'

app.server = app.listen(port, () => {
console.log(`server running @ http://localhost:${port}`)
app.server = app.listen(port, host, () => {
console.log(`server running @ http://${host}:${port}`)
})

module.exports = app

0 comments on commit 8bde785

Please sign in to comment.