{"id":18614997,"url":"https://github.com/andrewjbateman/header-parser-microservice","last_synced_at":"2026-04-11T14:34:16.035Z","repository":{"id":96859466,"uuid":"134165898","full_name":"AndrewJBateman/header-parser-microservice","owner":"AndrewJBateman","description":":clipboard: Obtains IP address, language and operating system from request header","archived":false,"fork":false,"pushed_at":"2024-03-25T19:56:21.000Z","size":189,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T01:34:29.388Z","etag":null,"topics":["express","freecodecamp","glitch","heroku","javascript","json","microservices","node","nodejs","npm","npm-module"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-20T16:09:49.000Z","updated_at":"2022-03-23T12:52:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"42d6ea9d-86b4-480a-9d5b-ec4d7903add2","html_url":"https://github.com/AndrewJBateman/header-parser-microservice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/header-parser-microservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fheader-parser-microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fheader-parser-microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fheader-parser-microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fheader-parser-microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/header-parser-microservice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fheader-parser-microservice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31684525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","freecodecamp","glitch","heroku","javascript","json","microservices","node","nodejs","npm","npm-module"],"created_at":"2024-11-07T03:27:47.682Z","updated_at":"2026-04-11T14:34:16.014Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Request Header Parser Microservice for freeCodeCamp\n\n* Parses data from a HTTP request header using the Node.js npm module `request-ip`\n* `request-ip` was published 3 years ago so this is old code and does not actually return an ip address\n* This was part of the FreeCodeCamp exercises for Front End Certification\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/header-parser-microservice?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/header-parser-microservice?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/header-parser-microservice?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/header-parser-microservice?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Request Header Parser Microservice for freeCodeCamp](#zap-request-header-parser-microservice-for-freecodecamp)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Original instructions (User Stories) from FCC:\n\n1. I can get the IP address, preferred languages (from header `Accept-Language`) and system info (from header `User-Agent`) for my device.\n\n* Returns `::1, when using IPv6`\n\n## :camera: Screenshots\n\n![Example screenshot](./img/header.png).\n\n## :signal_strength: Technologies\n\n* [Node v16](https://nodejs.org/en/) javaScript runtime built on Chrome's V8 JavaScript engine\n* [Express v5](https://expressjs.com/) Fast, unopinionated, minimalist web framework for Node.js\n* [request-ip v2](https://www.npmjs.com/package/request-ip) node.js middleware for retrieving a request's IP address.\n* [CORS v2](https://www.npmjs.com/package/cors) node.js package for providing Connect/Express middleware that can be used to enable CORS with various options.\n\n## :floppy_disk: Setup\n\n* Run `node server.js` for a dev server. Navigate to `http://localhost:8080/`.\n* Navigate to `http://localhost:8080/api/whoami` to see your system info.\n* The app will not automatically reload if you change any of the source files.\n\n## :computer: Code Examples\n\n* extract from `server.js` to get info. from http request header\n\n```javascript\napp.get(\"/api/whoami\", (req, res) =\u003e {\n  const header = req.headers;\n  console.log('header: ', header);\n\n  const sysInfo = header[\"user-agent\"]\n\n  let language = header[\"accept-language\"];\n  language = language.slice(  0, language.indexOf(\";\")  );\n\n  const host = header[\"host\"];\n\n  const clientIp = requestIp.getClientIp(req);\n\n  const result = {\n    \"IP address\" : clientIp,\n    \"language\": language,\n    \"system info\": sysInfo,\n    \"host\": host\n  };\n\n  console.log('result: ', result);\n  res.send()\n  res.send(result);\n});\n```\n\n## :cool: Features\n\n* nothing cool about this, doesn't even return the full ip address \u0026 npm module has not been updated for 3 years. The [ipapi](https://ipapi.co/) API returns the user external ip address.\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working\n* To-Do: Nothing\n\n## :clap: Inspiration\n\n* [freeCodeCamp's APIs and Microservices Projects - File Metadata Microservice](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/request-header-parser-microservice)\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fheader-parser-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fheader-parser-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fheader-parser-microservice/lists"}