diff --git a/build/etc/production.json b/build/etc/production.json index af20d17..f660081 100644 --- a/build/etc/production.json +++ b/build/etc/production.json @@ -1,4 +1,8 @@ { + "server": { + "address": "0.0.0.0", + "port": 3000 + }, "database": { "driver": "sqlite", "connection_string": "/opt/overseer/data/overseer.db" diff --git a/config/default.json b/config/default.json index 5d70d76..6f97fa3 100644 --- a/config/default.json +++ b/config/default.json @@ -1,4 +1,8 @@ { + "server": { + "address": "0.0.0.0", + "port": 3000 + }, "database": { "driver": "sqlite", "connection_string": "data/overseer.db" diff --git a/index.js b/index.js index e06826e..bea1024 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const session = require('express-session'); // instantiate new express.js app const app = express(); -const port = 3000; +const config = require('config'); // initialize database connection (async () => { @@ -50,6 +50,6 @@ app.get('/item/:id/edit', itemRoutes.getItemEdit); app.post('/item/:id/edit', itemRoutes.postItemEdit); // start app -app.listen(port, () => { - console.log(`Example app listening on port ${port}`); +app.listen(config.get('server.port'), config.get('server.address'), () => { + console.log(`Overseer is listening on port ${config.get('server.port')}.`); });