{"id":19044797,"url":"https://github.com/salvillalon45/requestheaderparser-freecodecamp","last_synced_at":"2026-04-12T15:01:22.103Z","repository":{"id":213593201,"uuid":"734478618","full_name":"salvillalon45/requestHeaderParser-freeCodeCamp","owner":"salvillalon45","description":"Curious to learn what is inside a request header?","archived":false,"fork":false,"pushed_at":"2024-02-01T19:36:32.000Z","size":242,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T22:47:26.432Z","etag":null,"topics":["express-js","javascript","nodejs","render","rest-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/salvillalon45.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}},"created_at":"2023-12-21T19:36:09.000Z","updated_at":"2024-02-01T19:35:13.000Z","dependencies_parsed_at":"2024-01-17T03:28:04.089Z","dependency_job_id":"8ed52075-7caa-487e-8b0f-034ac1768c61","html_url":"https://github.com/salvillalon45/requestHeaderParser-freeCodeCamp","commit_stats":null,"previous_names":["salvillalon45/freecodecamp-requestheaderparser","salvillalon45/requestheaderparser-freecodecamp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FrequestHeaderParser-freeCodeCamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FrequestHeaderParser-freeCodeCamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FrequestHeaderParser-freeCodeCamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2FrequestHeaderParser-freeCodeCamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salvillalon45","download_url":"https://codeload.github.com/salvillalon45/requestHeaderParser-freeCodeCamp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232169390,"owners_count":18482604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-js","javascript","nodejs","render","rest-api","typescript"],"created_at":"2024-11-08T22:47:30.513Z","updated_at":"2026-04-12T15:01:22.037Z","avatar_url":"https://github.com/salvillalon45.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Request Header Parser\n\nfreeCodeCamp - Back End Development and APIs | Project: Request Header Parser\n\n# Summary\n\nCreate a Request Header Parser api that when you make a request to `/api/whoami` it should return a JSON object with:\n\n-   IP address in the `ipaddress` key.\n-   Preferred language in the `language` key.\n-   Software in the `software` key.\n    **[Learn more about the Project Task.](https://www.freecodecamp.org/learn/back-end-development-and-apis/back-end-development-and-apis-projects/request-header-parser-microservice)**\n\n### Implementation\n\n-   Created a TypeScript + Express API\n-   Create a route called `/api/whoami` that retrieves the following:\n-   From the `req` object, we can get the **ip address**. The IP Address is a unique address that identifies a device on the internet or a local network.\n-   From the `headers` object, we can get:\n-   the **accept-language** header is used by a client (typically a web browser) to communicate to the server the preferred languages for content. The server can then use this information to provide content in the most suitable language for the user.\n-   the **user-agent header** is a standard HTTP header included in the request sent by a user agent, typically a web browser or a similar client, to provide information about the user agent (i.e., the software and device) making the request.\n\n#### Code implementation\n\n```\n  const { ip, headers } = req;\n\n\tconst ipaddress = ip;\n\tconst language = headers['accept-language'];\n\tconst software = headers['user-agent'];\n\tconst responseObject = {\n\t\tipaddress,\n\t\tlanguage,\n\t\tsoftware\n\t};\n```\n\n### Demo\n\n\u003cimg alt=\"Request Header Parser Demo\" src=\"./request_header_parser_demo.gif\" width=\"600\" /\u003e\n\n# Technologies:\n\n-   JavaScript\n-   TypeScript\n-   Render\n-  NodeJS\n-   ExpressJS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalvillalon45%2Frequestheaderparser-freecodecamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalvillalon45%2Frequestheaderparser-freecodecamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalvillalon45%2Frequestheaderparser-freecodecamp/lists"}