This is my request header parser for freeCodeCamp's second API project. Demo is available on my site. You can also check out my other freeCodeCamp projects.
It seems we're short on user stories, this is the only one this time:
- I can get the IP address, preferred languages (from header
Accept-Language) and system infos (from headerUser-Agent) for my device.
[project_url]/api/whoami
{
"ipaddress": "86.205.25.192",
"language": "en-GB",
"software": "Macintosh; Intel Mac OS X 10_13_6"
}- ESLint linter with Airbnb's base config
- Express.js framework
- Jest test framework
- Pug template engine
- Supertest library
git clone https://github.com/zsoltime/fcc-api-request-header.git
cd fcc-api-request-headernpm installIt starts a dev server, monitor for changes and restarts on any change.
npm run devIt starts the node.js application.
npm startIt runs tests using Jest and Supertest.
npm test