Added config options to define what host address and port to listen on
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
9afe8c5391
commit
30e23caf7f
@ -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"
|
||||||
|
@ -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"
|
||||||
|
6
index.js
6
index.js
@ -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')}.`);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user