Route in Express

noun

say it: “ROWT in ek-SPRES” /raʊt ɪn ɪkˈsprɛs/

A pairing in Express of an HTTP method and a path with the function that answers it, such as GET /orders.

What is Route in Express?

A route connects an HTTP method and path to a handler function.

app.get('/recipes', listRecipes);
app.post('/recipes', createRecipe);

In a sentence

  • “The app has a route for GET /tickets and another for POST /tickets.”
  • “A request that matches no route gets Express's 404.”

Level: Apprentice · More Node.js terms at this level

Updated