Read: Class 08 : Express Routing & Connected API - Goorob-401-advanced-javascript/amman-javascript-401d1 GitHub Wiki
Routing : refers to how an application’s endpoints (URIs) respond to client requests.
we define routing using methods of the Express app object that correspond to HTTP methods; for example, app.get() to
handle GET requests and app.post to handle POST requests.
These routing methods specify a callback function (sometimes called “handler functions”) called when the application
receives a request to the specified route (endpoint) and HTTP method. In other words, 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.
A route method is derived from one of the HTTP methods, and is attached to an instance of the express class.
Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be
strings, string patterns, or regular expressions.
Route parameters are named URL segments that are used to capture the values specified at their position in the URL. The captured values are populated in the req.params object, with the name of the route parameter specified in the path as their respective keys.
Route handlers can be in the form of a function, an array of functions, or combinations of both .