I am unable to pass this test and can’t understand why. I’ve read multiple posts about bugs in the FCC test suite for this course and I wonder whether this challenge is impacted.
Code snippet:
const logger = (req, res, next) => {
let str = req.method + " " + req.path + " - " + req.ip;
console.log(str);
next();
}
app.use(logger)
Example of logs returned in the console:
GET/public/style.cssNaN
*
GET/NaN
*
GET/public/style.cssNaN
https://www.freecodecamp.org
*
Project link
solution: https://replit.com/@drrompecabezas/boilerplate-express
Challenge: Implement a Root-Level Request Logger Middleware
Link to the challenge: