Routing
Routing
Routing
• Define routes based on HTTP methods and URLs.
• Express Router helps organize routes and middleware
Middleware
• Functions that have access to the request object (req), the response object (res), and the next
middleware in the application’s request-response cycle
• Can execute code, modify request and response objects, end the request-response cycle, or call the
next middleware.
middleware is widely used to handle common tasks in web applications.
The ' next ( ) ' function is a function in the Express router which, when invoked, executes the middleware
succeeding the current middleware
Method Request
Method Response