An array of routes to match against.
The incoming HTTP request.
The matched route, or undefined if no match is found.
Example usage:
import { router, text, matchRoute } from "@pulsar-http/core";
const routes = [
router.get('/api/users', async () => text('User List')),
];
// Faking the request for the example
const route = matchRoute(routes, new Request('http://localhost:3000/api/users'));
In this example route
value is:
{
method: "GET",
path: "/api/users",
handler: [AsyncFunction: AsyncFunction],
}
Matches a request to one of the available routes.