Here's my Request header parser

Here's my Request header parser
0

#1

Comments?
http://whoami-micro-svc.herokuapp.com


#2

It returns the (arguably) incorrect IP for me - the example uses IPv4, but I think you are returning IPv6.

I crossed checked my ip on your API vs one of the mainstream ‘what is my ip’ sites and got differing values.


#3

Ok…I think I’ve got this fixed. I was using request.connection.remoteAddress to return the ip but that should have been request.ip…
Try it again and thanks!


#4

That’s funny - I somehow started with req.ip and it was returning the IPv6 ip for me, so I did some ‘jumping though multiple hoops’ thing I found on Stack Overflow to get the IPv4. I may have to revisit mine and see if there is a simpler way of doing it.


#5

looks nice and I like your index file