Skip to content

Commit

Permalink
Add middleware which logs details about incoming requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Kritenberg committed May 17, 2023
1 parent 7ca876a commit 80f677a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const app = express();

app.listen(3000);

app.use((req, res, next) => {
console.log('Incoming request; URL: %s; Method: %s', req.url, req.method);
next();
})

app.get('/try', (req, res) => {
res.send('<p> Hello World1 </p>')
})
Expand Down

0 comments on commit 80f677a

Please sign in to comment.