Added config options to define what host address and port to listen on
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2022-11-04 18:07:44 -04:00
parent 9afe8c5391
commit 30e23caf7f
3 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,8 @@
{ {
"server": {
"address": "0.0.0.0",
"port": 3000
},
"database": { "database": {
"driver": "sqlite", "driver": "sqlite",
"connection_string": "/opt/overseer/data/overseer.db" "connection_string": "/opt/overseer/data/overseer.db"

View File

@ -1,4 +1,8 @@
{ {
"server": {
"address": "0.0.0.0",
"port": 3000
},
"database": { "database": {
"driver": "sqlite", "driver": "sqlite",
"connection_string": "data/overseer.db" "connection_string": "data/overseer.db"

View File

@ -4,7 +4,7 @@ const session = require('express-session');
// instantiate new express.js app // instantiate new express.js app
const app = express(); const app = express();
const port = 3000; const config = require('config');
// initialize database connection // initialize database connection
(async () => { (async () => {
@ -50,6 +50,6 @@ app.get('/item/:id/edit', itemRoutes.getItemEdit);
app.post('/item/:id/edit', itemRoutes.postItemEdit); app.post('/item/:id/edit', itemRoutes.postItemEdit);
// start app // start app
app.listen(port, () => { app.listen(config.get('server.port'), config.get('server.address'), () => {
console.log(`Example app listening on port ${port}`); console.log(`Overseer is listening on port ${config.get('server.port')}.`);
}); });