r/node • u/Muted_Cat_5748 • 2d ago
How to express js
I'm new to this. i don't know how to learn and what to learn
0
Upvotes
r/node • u/Muted_Cat_5748 • 2d ago
I'm new to this. i don't know how to learn and what to learn
4
u/bluejacket42 2d ago
what are you trying to do?
4
u/karmatics29 2d ago
Pick one small project and learn Express by building it. Rough path: 1) Get comfortable with core JavaScript first: promises, async/await, modules, array methods. 2) Run npm init, install express, and write a server with one GET route returning JSON. 3) Add a POST route using the express.json() middleware, and learn how middleware order works, since that is the core idea of Express. 4) Split routes into routers, add error-handling middleware and input validation. 5) Connect a database (Postgres or MongoDB) and add authentication. A simple todo REST API covers all of that. Trade-off: Express is minimal and teaches the fundamentals, but you design the structure yourself; something like NestJS can come later once the basics make sense.
3
u/PierrickP 2d ago
https://expressjs.com/en/5x/starter/hello-world/