First steps — Basics · Express

An Express app is a list of routes and a call to listen(). Answer the cats as JSON, one cat by its id, a 404 for a missing one, and a name as plain text rather than the HTML Express assumes for a string.

What you will learn

Read the theory for First steps

All Basics lessons

All Express courses

loading types…

What you'll learn

  • Create an app with express(), add routes with app.get(), and start it with app.listen()
  • Read path parameters from req.params and the query string from req.query
  • Answer with res.json() and res.send(), set the status with res.status() and the content type with res.type()