https://github.com/divinedev-dotcom/header-parser
Request Header Parser Microservice
https://github.com/divinedev-dotcom/header-parser
Last synced: 2 months ago
JSON representation
Request Header Parser Microservice
- Host: GitHub
- URL: https://github.com/divinedev-dotcom/header-parser
- Owner: divineDev-dotcom
- License: mit
- Created: 2023-05-22T05:54:10.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-22T05:55:11.000Z (about 3 years ago)
- Last Synced: 2025-03-23T06:44:46.695Z (over 1 year ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Request Header Parser Microservice
This is a simple Node.js application that acts as a Request Header Parser Microservice. It provides an API endpoint that returns information from the request headers.
## How to Use
1. Clone the repository or download the code.
2. Make sure you have Node.js and npm installed on your system.
3. Install the dependencies by running `npm install`.
4. Start the server by running `node index.js`.
5. The server will start running on `http://localhost:3000`.
6. Access the API endpoint at `http://localhost:3000/api/whoami`.
7. The API will return a JSON response containing the requester's IP address, preferred language, and software/browser information.
## API Endpoint
- `GET /api/whoami`: Returns a JSON object with the requester's IP address, preferred language, and software/browser information from the request headers.
## Example Response
```json
{
"ipaddress": "::ffff:127.0.0.1",
"language": "en-US,en;q=0.9",
"software": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
}