Update: I joined the HNG13 internship by Hotels.ng.
Here is a break down of the stage 0 task and what I learned doing this task.
The task required me to build a RESTful API endpoint that returns my profile information along with a dynamic cat fact fetched from an external API.
{
"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>"
}
The response must be in the JSON format above.
The fact is fetched from this source: catfact.
Here are the project specification:
Field specifications:
status — Must always be the string "success"
user.email — Your personal email address
user.name — Your full name
user.stack — Your backend technology stack (e.g., "Node.js/Express", "Python/Django", "Go/Gin"). I used Node.js/Express for my project
timestamp — Current UTC time in ISO 8601 format (e.g., "2025-10-15T12:34:56.789Z")
fact — A random cat fact fetched from the Cat Facts API
It's simple project, However, I learned a few things working on this project.
- I learned to use express-rate-limit package
Hosted my API on railway.com. I encountered a few challenges using railway as it was my time.
Split my project into server.js and app.js. (Application server logic lives inside the server.js file while the main application logic, middlewares, cors, and rate limiting logic lives inside the app.js file)
With this project, I learned to fetch resources from external APIs and handle errors gracefully when the API fails.
Visit this github repository to see the full code and README file. Code
Top comments (0)