Basic Node and Express - Implement a Root-Level Request Logger Middleware

Tell us what’s happening:
Describe your issue in detail here.
Get the following error when I try to run the test.

Root level logger middleware should be active
// test completed
//console output
[Error]

Here is my code:

app.use(function(req, res, next) {
var string = req.method + " " + req.path + " - " + req.ip;
console.log(string);
next()
});

Your project link(s)

solution: boilerplate-express (2) - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Basic Node and Express - Implement a Root-Level Request Logger Middleware

Link to the challenge:

Did you fix it? Your code is passing for me.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.