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

Code that is passing on Replit is also now failing for me locally.

Not sure what the issue is but newer Node.js versions seem to be causing issues with some of the tests. I had to change the localhost to use in another challenge and in this challenge, if I go back to Node.js v16.18.0 it passes the logger test again (from v18).

Node.js v16.18.0 logs

GET /json - ::ffff:

Node.js v18.12.1 logs

GET /json - ::1

Which is an IPv6 address

I think this is related to Node.js switching the IP order

Node.js now returns IP addresses in the order they are returned from the name resolver/DNS

You can set the dns in server.js which should fix it (does for me).

const dns = require('dns');

Or using nvm/nvm-windows and switching to Node.js 16 should fix it as well (nvm is just a Node.js version manager).