curriculum/challenges/english/blocks/back-end-development-and-apis-projects/bd7158d8c443edefaeb5bdff.md
Build a full-stack JavaScript app that is functionally similar to this: <a href="https://request-header-parser-microservice.freecodecamp.rocks/" target="_blank" rel="noopener noreferrer nofollow">https://request-header-parser-microservice.freecodecamp.rocks/</a>. Working on this project will involve you writing your code using one of the following methods:
You should provide your own project, not the example URL.
assert(
!/.*\/request-header-parser-microservice\.freecodecamp\.rocks/.test(
code
)
);
A request to /api/whoami should return a JSON object with your IP address in the ipaddress key.
const response = await fetch(code + '/api/whoami');
if (!response.ok) {
throw new Error(await response.text());
}
const data = await response.json();
assert(data.ipaddress && data.ipaddress.length > 0);
A request to /api/whoami should return a JSON object with your preferred language in the language key.
const response = await fetch(code + '/api/whoami');
if (!response.ok) {
throw new Error(await response.text());
}
const data = await response.json();
assert(data.language && data.language.length > 0);
A request to /api/whoami should return a JSON object with your software in the software key.
const response = await fetch(code + '/api/whoami');
if (!response.ok) {
throw new Error(await response.text());
}
const data = await response.json();
assert(data.software && data.software.length > 0);