2019-05-06 07:31:26 -04:00
---
id: bd7158d8c443edefaeb5bdff
2021-02-06 04:42:36 +00:00
title: Request Header Parser Microservice
2019-05-06 07:31:26 -04:00
challengeType: 4
2020-09-18 00:11:18 +08:00
forumTopicId: 301507
2021-01-13 03:31:00 +01:00
dashedName: request-header-parser-microservice
2019-05-06 07:31:26 -04:00
---
2020-12-16 00:37:30 -07:00
# --description--
2021-02-06 04:42:36 +00:00
Build a full stack JavaScript app that is functionally similar to this: < https: / / request-header-parser-microservice . freecodecamp . rocks / > . Working on this project will involve you writing your code using one of the following methods:
2019-05-06 07:31:26 -04:00
2021-02-06 04:42:36 +00:00
- Clone [this GitHub repo ](https://github.com/freeCodeCamp/boilerplate-project-headerparser/ ) and complete your project locally.
- Use [our repl.it starter project ](https://repl.it/github/freeCodeCamp/boilerplate-project-headerparser ) to complete your project.
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
2019-05-06 07:31:26 -04:00
2021-02-06 04:42:36 +00:00
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
2019-05-06 07:31:26 -04:00
2020-12-16 00:37:30 -07:00
# --hints--
2019-05-06 07:31:26 -04:00
2021-02-06 04:42:36 +00:00
You should provide your own project, not the example URL.
```js
(getUserInput) => {
assert(
!/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test(
getUserInput('url')
)
);
};
```
A request to `/api/whoami` should return a JSON object with your IP address in the `ipaddress` key.
2019-05-06 07:31:26 -04:00
```js
2020-12-16 00:37:30 -07:00
(getUserInput) =>
$.get(getUserInput('url') + '/api/whoami').then(
(data) => assert(data.ipaddress & & data.ipaddress.length > 0),
(xhr) => {
throw new Error(xhr.responseText);
}
);
2019-05-06 07:31:26 -04:00
```
2020-08-13 17:24:35 +02:00
2021-02-06 04:42:36 +00:00
A request to `/api/whoami` should return a JSON object with your preferred language in the `language` key.
2020-12-16 00:37:30 -07:00
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/whoami').then(
(data) => assert(data.language & & data.language.length > 0),
(xhr) => {
throw new Error(xhr.responseText);
}
);
```
2021-02-06 04:42:36 +00:00
A request to `/api/whoami` should return a JSON object with your software in the `software` key.
2020-12-16 00:37:30 -07:00
```js
(getUserInput) =>
$.get(getUserInput('url') + '/api/whoami').then(
(data) => assert(data.software & & data.software.length > 0),
(xhr) => {
throw new Error(xhr.responseText);
}
);
```
# --solutions--
2021-01-13 03:31:00 +01:00
```js
/**
Backend challenges don't need solutions,
because they would need to be tested against a full working project.
Please check our contributing guidelines to learn more.
*/
```