https://github.com/lependu/fcc-whoami
https://github.com/lependu/fcc-whoami
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lependu/fcc-whoami
- Owner: lependu
- License: mit
- Created: 2017-07-21T08:14:21.000Z (almost 9 years ago)
- Default Branch: 0.1.0
- Last Pushed: 2017-09-04T11:26:05.000Z (over 8 years ago)
- Last Synced: 2025-08-17T10:23:58.042Z (10 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Free code camp
[request header praser](https://www.freecodecamp.org/challenges/request-header-parser-microservice)
microservice challange.
### Endpoints
## `GET /whoami`
**Description:** Returns parsed headers. It requires
Accept-Language, User-Agent, X-Forwarded-For request headers to be set.
If request header(s) is not defined, it returns `null`.
**Example response:**
```JSON
{
"ipaddress": "192.168.1.1",
"language": "en-US",
"software": "X11; Linux x86_64; rv:50.0"
}
```
### Errors
## `404`
```JSON
{
"message": "Not Found",
}
```
### Development
- development server with nodemon
`$ npm run dev`
visit http://localhost:3000
### Tests
- lint `$ npm run lint`
- test `$ npm run test`
- coverage `$ npm run coverage`
### Deployment
The deployment process depends on your server and needs.
[Here](https://egghead.io/lessons/node-js-setup-an-nginx-proxy-for-a-node-js-app-with-docker)
you can find a cool tutorial how to setup an `nginx` proxy for a `Node.js` app.