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. 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. Specify middleware as the callback function (See Using middleware for details). You can also use app.all() to handle all HTTP methods and app.use() to You define routing using methods of the Express app object that correspond to HTTP methods įor example, app.get() to handle GET requests and app.post to handle POST requests. Routing refers to how an application’s endpoints (URIs) respond to client requests.įor an introduction to routing, see Basic routing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |