app.get("/api/whoami/", function(req,res){
const ipAddress=req.headers['x-forwarded-for'] ||
req.connection.remoteAddress ||
req.socket.remoteAddress ||
(req.connection.socket ? req.connection.socket.remoteAddress : null);
const defaultLang=req.headers["accept-language"];
res.json({"ipaddress":ipAddress,"language":defaultLang,
"software":req.headers['user-agent']})
});
Challenge: Request Header Parser Microservice
Link to the challenge: