Skip to content

Commit

Permalink
log all requests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispsheehan committed Sep 11, 2024
1 parent 979848d commit 8853ca0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ const port = process.env.PORT;

app.listen(port)

app.use((req, res, next) => {
console.log(`Request received: ${req.method} ${req.url}`);
next();
});

app.get('/hello', (req, res) => {
res.status(200).json({msg: "Hello, this is your API"});
});
Expand Down

0 comments on commit 8853ca0

Please sign in to comment.