Tell us what’s happening:
I added this code at the beginning of the code, after the require but it is still not passing the test
app.use(function(req,res,next){
console.log(req.method + " " + req.path + " - " + req.ip);
next()
});
Your project link(s)
solution: localhost:3000
Challenge: Basic Node and Express - Implement a Root-Level Request Logger Middleware
Link to the challenge:
1 Like
lasjorg
2
Post a link to a GitHub repo with all your code. We can’t really debug this just based on the code you posted.
But the code you posted is passing for me with my own setup on Replit.
That’s repository for the part “Basic Node and Express”, I already completed the rest of the tests, only this one remain to be completed.
FreeCodeCampCourses/boilerplate-express-main at main · Gabriellqe/FreeCodeCampCourses (github.com)
Try explicitly using IPv4
Add to server.js at the top of the file.
const dns = require('dns');
dns.setDefaultResultOrder('ipv4first');
More info
1 Like
Thanks with this pass the test!