Skip to content

Commit 74471aa

Browse files
committed
Removing unused code and adding config to index
1 parent 12ab135 commit 74471aa

5 files changed

Lines changed: 8 additions & 21 deletions

File tree

config/custom-environment-variables.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"url": "DATABASE_URL",
55
"port": "DATABASE_PORT",
66
"dbName": "DATABASE_NAME"
7-
}
7+
},
8+
"port": "APP_PORT"
89
}
910
}

config/default.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"App": {
33
"database": {
4-
"url": "mongodb://mongodb",
4+
"url": "mongodb://localhost",
55
"port": 27017,
66
"dbName": "development"
7-
}
7+
},
8+
"port": 3000
89
}
910
}

config/environment.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

docker-compose.development.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
app:
44
build: .
55
environment:
6-
NODE_ENV: development
6+
NODE_ENV: docker
77
command: node_modules/.bin/nodemon --exec npm start
88
ports:
99
- '3000:3000'

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const log = require('./src/log');
22
const { setupApp } = require('./src/app');
3-
const config = require('./config/environment');
3+
const config = require('config');
44

55
setupApp()
6-
.then(app => app.listen(config.port, () => log.info(`app running on port ${config.port}`)))
6+
.then(app => app.listen(config.get('App.port'), () => log.info(`app running on port ${config.get('App.port')}`)))
77
.catch(error => {
88
log.error(error);
99
process.exit(1); // eslint-disable-line

0 commit comments

Comments
 (0)