So, today, I learned Express middleware:
→ What next() really does
→ Why forgetting it breaks your app
→ Middleware runs before routes
→ Order matters a LOT
→ Don’t use next() after res.send()
Backend is becoming more interesting now.
#buildinpublic#NodeJS#ExpressJS
So today I moved from Node HTTP to Express
I learned:
1) app.get() makes routing cleaner
2) res.send vs res.json
3) Express handles res.end() internally
4) app.use() is a catch-all for routes
Backend is starting to make more sense now 🔥
#buildinpublic#NodeJS#ExpressJS
Good morning devs... Hope you all had a wonderful night rest.
Tell me what you're building currently and it's use case. Maybe I will become your first user.
So today, I built a Node.js server with:
→ Routing (/home, /about, /contact)
→ First API endpoint (/api/users)
→ JSON responses
Also debugged a tricky bug (forgot () in toLowerCase 😅)
Starting to really understand how servers work
#buildinpublic#NodeJS#backend
So guys, today, I learned Node.js basics + fs module
→ Read files with fs.readFile
→ write files with fs.writefile
→ Learned how errors work (throw vs handling)
I also debugged file path issues
Backend already feels very different from frontend 😂
#buildinpublic
One thing I have realized that I don't like doing is watching tutorials.
I prefer building any time, any day.
Y'all that watch tutorials, how do you do that without falling asleep or getting distracted mid way.
Just drafted a roadmap for learning backend development.
And I have a question: between PostgreSQL and MongoDB, which is the better database framework to learn?
Good morning and happy Friday to everyone.
What are you doing today, and how do you plan to make the most of it?
And remember to have some fun today. Being a developer doesn't mean you can't enjoy yourself. Do something fun outside of coding today.