diff --git a/config.js b/config.js index cc42656..2af824a 100644 --- a/config.js +++ b/config.js @@ -1,2 +1,3 @@ exports.port = process.env.PORT || 5001 +exports.host = process.env.HOST || 'localhost' exports.origin = process.env.ORIGIN || `http://localhost:${exports.port}` diff --git a/server.js b/server.js index 24f3b5e..d5b3aa4 100644 --- a/server.js +++ b/server.js @@ -62,6 +62,6 @@ app.post('/contacts', bodyParser.json(), (req, res) => { } }) -app.listen(config.port, () => { +app.listen(config.port, config.host, () => { console.log('Server listening on port %s, Ctrl+C to stop', config.port) })