Express Basics
Express Basics: Your First Express App: Routes and JSON, Route and Query Parameters.
Updated
- Your First Express App: Routes and JSON (Apprentice): Express turns each endpoint into one line that names its method and path, answers with res.json, and reads a JSON body from req.body once express.json() is switched on, so a small API takes a few lines instead of sixty.
- Route and Query Parameters (Apprentice): A route parameter such as /games/:id lets one route answer every game, read from req.params, and query parameters such as ?players=4 arrive in req.query, both always as text that you turn into numbers before you compare them.