MCPcopy Create free account
hub / github.com/EvoMap/evolver / _matchRoute

Method _matchRoute

src/proxy/server/http.js:334–343  ·  view source on GitHub ↗
(method, pathname)

Source from the content-addressed store, hash-verified

332 }
333
334 _matchRoute(method, pathname) {
335 for (const [pattern, handler] of Object.entries(this.routes)) {
336 const [routeMethod, routePath] = pattern.split(' ');
337 if (routeMethod !== method) continue;
338
339 const params = matchPath(routePath, pathname);
340 if (params !== null) return { handler, params };
341 }
342 return null;
343 }
344}
345
346function matchPath(pattern, pathname) {

Callers 1

_handleRequestMethod · 0.95

Calls 1

matchPathFunction · 0.70

Tested by

no test coverage detected