Skip to content

Commit cddf4c2

Browse files
Fix bug from logging
1 parent 7f22a9a commit cddf4c2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backend/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const server = require('http').createServer(app)
2323

2424
app.listen(3100, () => {
2525
logger.info('Grappa app listening on port 3100!')
26-
logger.info('Debugging version: 0.0.4')
26+
logger.info('Debugging version: 0.0.5')
2727
logger.info(`Environment is ${process.env.NODE_ENV}`)
2828
})
2929

backend/src/middleware/auditLogger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const loggedMethods = ['POST', 'PUT', 'DELETE']
55

66
module.exports = function auditLogger(req, res, next) {
77
console.log("Req: " + req.method + " " + req.originalUrl + " at " + new Date().toString())
8-
console.log("body keys: " + Object.keys(req.body))
8+
if (req?.body) console.log("body keys: " + Object.keys(req.body))
99
if (loggedMethods.includes(req.method)) {
1010
const type = `${req.method} ${req.originalUrl}`
1111

0 commit comments

Comments
 (0)