Read 08 Express Routing & Connected API - 401-advanced-javascript-hanna-alemu/seattle-javascript-401d31 GitHub Wiki

What is Routing?

Routing refers to how an application’s endpoints (URIs) respond to client requests.

How do we create them?

We create routes by using an Express app object that corresponds to HTTP methods which may be:

  • get()
  • post()
  • put()
  • delete() The application “listens” for requests that match the specified route(s) and method(s), and when it detects a match, it calls the specified callback function.

What is Middleware?

Route middleware in Express is a way to do something before a request is processed.