Makes an asynchronous HTTP call using the provided request object.
Routes the request to the appropriate handler and returns the response. If no response is returned from the primary handler, it executes the fallback handler.
This function is normally considered internal, but it can be used in unit- and integration testing to avoid spinning up a server.
the HTTP request object containing all necessary details for the call.
Sets a fallback handler for the service.
The specified handler will be used as a fallback to handle any requests that do not match existing routes.
the function to be used as a fallback handler.
Applies the specified layer to all previously registered routes.
the layer to be applied to the endpoints.
Nests a given router under a specific path.
the base path where the nested router will be applied.
the router instance to be nested under the specified path.
Resets the fallback handler to the default.
Defines a route for a specified path and associates it with a method router.
the URL path to define the route for.
the router that handles the methods for the given path.
The Router class is responsible for handling and routing HTTP requests based on specified paths and methods.
It allows nesting of sub-routers, adding layers, defining fallback handlers, and processing requests.