Let's discuss your Request Header Parser Microservice

Let's discuss your Request Header Parser Microservice
0.0 0

#1

Hi everyone, just finished my Request Header Parser Microservice!:

https://request-header-parser-88d.herokuapp.com/

I am using the ua-parser module for the user agent header and accepts module for the accept-language header!

Any feedback to improve the code appreciated!


#2

Can you share the GitHub link your code?

Here’s mine:
Heroku: https://pure-atoll-37904.herokuapp.com

Gh: https://github.com/JacksonBates/request-header-parser-microservice-fcc


#3

sure! here it is: https://github.com/chemok78/fcc-jay-request-header-parser


#4

Hi Jackson, what does this code do in your app?:

var ip = request.headers[‘x-forwarded-for’] ||

         request.connection.remoteAddress ||
  
  
         request.socket.remoteAddress ||
  
  
         request.connection.socket.remoteAddress;

#5

I was having trouble getting an IPv4 address - I kept getting IPv6. This was a snippet I got from stack overflow that fixed my issue, but I’ve seen other examples since that didn’t need this, so I’ll revisit it some time to see how necessary it really is and how to simplify it.


#6

I notice we use different ua parser modules - that may be where my issue was with my ip.


#7

yeah im using this one https://www.npmjs.com/package/ua-parser, which works fine for me


#8

Project Link => https://req-parser.herokuapp.com/
Source Code => https://github.com/AungMyoKyaw/RequestHeaderParser


#9

Project Link – > https://brusbilis.com/freecodecamp/v1/apis/parser/parser.html

Source Code --> https://github.com/brusbilis/freeCodeCamp/tree/master/v1/back-end/apis


#10

This seemed too easy, if not for that nasty ip quirk…

Project link => https://headerparsermicroservice.herokuapp.com/api/whoami
Source code: https://github.com/pilgrim011/headerParser


#11

Project link: https://headerparser-joey.herokuapp.com/

Source code: https://github.com/AsimoLoveGym/Request-Header-Parser-Microservice

Just tested on my side, if any issue from your visit, please let me know.


#12

Live project link
GitHub source code

Happy to hear any opinions, comments, suggestions, etc. :slight_smile:


#13

Nice - does chalk just pretty up the console logging?


#14

Yep, it just gives you the ability to make console.logs different colors. Definitely not necessary, but makes life a tad more fun and/or occasionally easier. :slight_smile:


#15

From Chalk’s readme:

"Windows

If you’re on Windows, do yourself a favor and use cmder instead of cmd.exe."

True dat, chalkie :slight_smile:


#16

Project link: https://req-header-parser.gomix.me/
Code: https://github.com/svmi3195/req-header-parser

I tried to do it with node only, I hope it works for all (kinda does for me, but haven’t tested much yet)


#17

Project link https://github.com/davidpickup/headerparser

This was quite straightforward after the micro service. Just had to work out the regex for parsing the OS.


#19

Heroku: https://requestheaderparserforfcc.herokuapp.com/
Github: https://github.com/olddognewtrix123/reqheaderparser


#20

Hi All! Please take a moment and let me know if this app is working correctly for you.

https://fcc-microservice-header.herokuapp.com/

Thank you!

Chris


#21

https://github.com/ARWL2016/req-header-parser-microservice
https://serene-anchorage-56334.herokuapp.com/

This one seemed pretty straightforward, but testing is tricky. Does anyone know a way of mocking GET requests from other IP addresses?