Skip to content

Commit

Permalink
fix: debug logs for server related informations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ealenn committed Jul 30, 2022
1 parent 3e2faa7 commit 3ad29a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ coverage:
precision: 2
ignore:
- "test/*"
- "src/middlewares/logMiddleware.js"
- "src/app.js"
- "src/middlewares/logMiddleware.js"
12 changes: 6 additions & 6 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const http = require('http')

// Signal handling
process.on('SIGTERM', () => {
console.log('Received SIGTERM signal. Gracefully stopping web server.');
console.debug('Received SIGTERM signal. Gracefully stopping web server.');
server.close(() => {
console.log('Server stopped sucessfully.');
console.debug('Server stopped sucessfully.');
});
});

Expand All @@ -35,9 +35,9 @@ app.use(require('./middlewares/customHttpBodyMiddleware'));

// Router
app.all('*', (req, res) => res.json({
host: require('./response/host')(req),
http: require('./response/http')(req),
request: require('./response/request')(req),
environment: require('./response/environment')(req)
host: require('./response/host')(req),
http: require('./response/http')(req),
request: require('./response/request')(req),
environment: require('./response/environment')(req)
}));
module.exports = server
2 changes: 1 addition & 1 deletion src/webserver.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const app = require('./app');
const config = require('./nconf');
app.listen(config.get('port'), () => console.log(`Listening on port ${config.get('port')}.`));
app.listen(config.get('port'), () => console.debug(`Listening on port ${config.get('port')}.`));

0 comments on commit 3ad29a4

Please sign in to comment.