Courses / Node.js
5. Routing basics (path matching)
Dispatch requests to handlers based on HTTP method and URL path using simple pattern matching.
1 min read Chapter 5 of 48
JavaScript
Routing basics (path matching)
Routing sends an incoming HTTP request to the correct handler based on its method and URL path.
"I want each URL to run the right code without a giant if/else chain."
Routing matches request methods (GET, POST, etc.) and path patterns (literal or parameterized) to select a handler function for that request.
"I want each URL to run the right code without a giant if/else chain."
Routing matches request methods (GET, POST, etc.) and path patterns (literal or parameterized) to select a handler function for that request.