Skip to content

Commit

Permalink
feat(config, lib): add server tiemout to config ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreBrisorgueil committed Oct 5, 2020
1 parent ef43f7c commit 7c905c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/defaults/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
port: 3000,
host: 'localhost',
base: 'api',
timeout: 2 * 60 * 1000,
},
db: {
uri: 'mongodb://localhost/WaosNodeDev',
Expand Down
4 changes: 2 additions & 2 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ exports.start = async () => {
}

try {
if (config.secure && config.secure.credentials) http = await nodeHttps.createServer(config.secure.credentials, app).listen(config.api.port, config.api.host);
else http = await nodeHttp.createServer(app).listen(config.api.port, config.api.host);
if (config.secure && config.secure.credentials) http = await nodeHttps.createServer(config.secure.credentials, app).setTimeout(config.api.timeout).listen(config.api.port, config.api.host);
else http = await nodeHttp.createServer(app).setTimeout(config.api.timeout).listen(config.api.port, config.api.host);
logConfiguration();
return {
db,
Expand Down

0 comments on commit 7c905c8

Please sign in to comment.