Skip to content

Commit 0499d83

Browse files
authored
Merge pull request #1169 from mathematicalthinking/404investigation
More logs for 404 error
2 parents b97ce2c + 7702791 commit 0499d83

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,14 @@ app.get('/*', (req, res) => {
120120
});
121121

122122
// catch 404 and forward to error handler
123-
app.use((_, __, next) => {
124-
const err = new Error('Not Found');
123+
app.use((req, res, next) => {
124+
const err = new Error(`Not Found: ${req.originalUrl}`);
125+
console.log('Time of 404 error:', new Date());
126+
console.log('Headers:', req.headers);
127+
console.log('Body:', req.body);
128+
console.log('Method:', req.method);
129+
console.log('URL:', req.originalUrl);
130+
console.log('Query:', req.query);
125131
err.status = 404;
126132
next(err);
127133
});

0 commit comments

Comments
 (0)