Okay, so “contestant 42” – sounds kinda mysterious, right? Well, it all started with this online coding challenge I stumbled upon. I’m always looking for ways to keep my skills sharp, so I thought, “Why not?”
The challenge was, build some RESTful API. I clicked on the link, got the instructions, and started to brainstorm. I was deciding what database should I use, I was thinking between Postgres or MongoDB, I went for the one I’ve been using the most lately, so, yeah, Mongo it is.

Setting Up
- First things first, I fired up my code editor. I am a VS Code fan!
- Then I created a new project folder. Keeps things tidy, you know?
- Next, I initialized a new * project.
npm init -y
, boom, done. - After that, time to install the basics: Express for the server, Mongoose for talking to MongoDB.
- I also like to use Nodemon, using the command line, to keep the server updated with all the changes.
Coding Time
With the setup out of the way, I started coding. I built out the basic server structure, defined my routes, all that jazz. Then came the models, mapping out how the data would look in the database.
I spent a good chunk of time just writing and testing the API endpoints. You know, making sure I could create, read, update, and delete stuff. Postman was my best friend here. I poked and prodded at my API, making sure it handled everything correctly.
Hitting a Snag
Of course, it wasn’t all smooth sailing. I ran into a weird bug where updates weren’t working quite right. I spent a good hour scratching my head, digging through the code, and finally realized I’d messed up a tiny bit of logic in the update function. Classic!
Victory!
After fixing that little hiccup, everything clicked into place. I tested everything one last time, and it all worked perfectly. I submitted my solution, feeling pretty good about it. I don’t know if I’ll win, but it was a fun little project, and I definitely learned a thing or two along the way.