MY HNG 13 Experience in the Backend track started with a stage 0 task to work on the logic on a profile endpoint when a call is made to the following endpoint below:
myendpoint/me
We return the following:
{
"status": "success",
"user": {
"email": "<your email>",
"name": "<your full name>",
"stack": "<your backend stack>"
},
"timestamp": "<current UTC time in ISO 8601 format>",
"fact": "<random cat fact from Cat Facts API>"
}
In order to achieve this, we needed to call an external API for the cats fact, I used Axios to call the API and also gracefully handled a scenario whereby if the API was down it does not bring down our server, a simple Alt text is returned as a fact stating that the server is down
This task taught me how to go about handling scenarios whereby we might have to call external API's that are down and how to gracefully handle them.
A Final Snippet is below of the response:
"status": "success",
"user": {
"email": "myexample@gmail.com",
"name": "Clinton Akinbayo",
"stack": "Node.js/Express"
},
"timestamp": "2025-10-18T10:48:48.012Z",
"fact": "Cat paws act as temperature regulators, shock absorbers, hunting and grooming tools, sensors, and more"
}
Looking forward to learning more and growing in HNG 13, let's go!!
Top comments (0)