<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: ALI OGOCHUKWU PETER</title>
    <description>The latest articles on Forem by ALI OGOCHUKWU PETER (@ali-peter).</description>
    <link>https://forem.com/ali-peter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1833679%2F13c68c51-2d43-443f-8270-9ba1f7740b13.png</url>
      <title>Forem: ALI OGOCHUKWU PETER</title>
      <link>https://forem.com/ali-peter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ali-peter"/>
    <language>en</language>
    <item>
      <title>My Journey Completing the HNG Internship Stage 0 Backend Task 🚀🐱</title>
      <dc:creator>ALI OGOCHUKWU PETER</dc:creator>
      <pubDate>Sat, 18 Oct 2025 13:44:06 +0000</pubDate>
      <link>https://forem.com/ali-peter/my-journey-completing-the-hng-internship-stage-0-backend-task-113l</link>
      <guid>https://forem.com/ali-peter/my-journey-completing-the-hng-internship-stage-0-backend-task-113l</guid>
      <description>&lt;p&gt;I just wrapped up the HNG Internship Stage 0 Backend Task as part of the #HNGi13 program, and I’m thrilled to share my experience! I built a RESTful API using Node.js and Express that serves a /me endpoint, returning my profile information and a dynamic cat fact fetched from the Cat Facts API. Here’s a deep dive into my process, challenges, and what I learned.&lt;/p&gt;

&lt;p&gt;What I Built&lt;/p&gt;

&lt;p&gt;The task was to create a GET /me endpoint that returns a JSON response with:&lt;br&gt;
status: Always "success"&lt;br&gt;
user: My email, name, and backend stack&lt;br&gt;
timestamp: Current UTC time in ISO 8601 format&lt;br&gt;
fact: A random cat fact fetched from the Cat Facts API&lt;/p&gt;

&lt;p&gt;Below are visuals of my work:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzdp2q63rvq2auxwh9q8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftzdp2q63rvq2auxwh9q8.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
My Express server code handling the /me endpoint.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1x4avu50smj0evqx0bfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1x4avu50smj0evqx0bfw.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
The JSON response from my live API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhsvrkfpp3slfmc7s52f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhsvrkfpp3slfmc7s52f.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
My Railway deployment dashboard showing the successful build.&lt;/p&gt;

&lt;p&gt;My Work Process&lt;br&gt;
Setting Up the API: I used Express to create a lightweight server and axios to fetch cat facts. I ensured the endpoint returns the exact JSON structure required, with dynamic timestamps using new Date().toISOString().&lt;/p&gt;

&lt;p&gt;Error Handling: I implemented try-catch blocks to handle potential failures of the Cat Facts API, returning a fallback error response with a 500 status code if needed.&lt;/p&gt;

&lt;p&gt;Environment Variables: I used dotenv to manage the server port, keeping sensitive configurations secure.&lt;/p&gt;

&lt;p&gt;Deployment: I deployed the API on Railway (since Vercel and Render were not allowed). I faced a challenge with a node_modules warning in the build log, which I resolved by adding node_modules/ to my .gitignore and redeploying.&lt;/p&gt;

&lt;p&gt;Documentation: I wrote a clear README.md for my GitHub repo, but initially, it rendered poorly due to missing Markdown formatting. I fixed this by adding proper headings and code blocks, making it professional and easy to follow.&lt;/p&gt;

&lt;p&gt;Challenges Faced&lt;br&gt;
Railway Deployment: Finding the public URL was tricky at first, as it wasn’t auto-generated. I learned to use the Railway dashboard’s Networking section to generate a domain.&lt;/p&gt;

&lt;p&gt;README Formatting: My initial README looked like plain text on GitHub. I revised it with proper Markdown syntax (e.g., #, ##, &lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash) to make it visually appealing.

Dynamic Data: Ensuring the cat fact and timestamp updated on every request required careful testing with Postman to confirm the API wasn’t caching responses.

What I Learned
Third-Party API Integration: Consuming the Cat Facts API taught me how to handle external API calls and manage timeouts/errors gracefully.

UTC Timestamps: I got hands-on experience formatting dates in ISO 8601 (e.g., 2025-10-18T12:34:56.789Z).

Deployment Best Practices: Deploying on Railway and resolving issues like the node_modules warning deepened my understanding of cloud platforms.

Documentation: Writing a clear, well-formatted README is crucial for open-source projects.

Git Hygiene: Using .gitignore to keep my repo clean was a valuable lesson.

Check Out My Work
GitHub Repository: https://github.com/Ali-Peter/hng-13-stage-0
Live API: https://hng-13-stage-0-production-51a2.up.railway.app/me

What’s Next?
I’m excited to continue my journey in the HNG Internship and tackle more backend challenges. I’d love to hear your feedback or tips for improving my API! Feel free to test the endpoint or check out my code. 💻

#HNGi13 #Backend #NodeJS #API #WebDevelopment #JavaScript #ExpressJS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>express</category>
      <category>node</category>
      <category>api</category>
      <category>backend</category>
    </item>
  </channel>
</rss>
