MCPcopy Create free account
hub / github.com/vercel/vercel / findMatchingRoute

Function findMatchingRoute

packages/cli/src/util/dev/server.ts:3347–3367  ·  view source on GitHub ↗
(
  match: BuildMatch,
  requestPath: string,
  devServer: DevServer,
  vercelConfig: VercelConfig
)

Source from the content-addressed store, hash-verified

3345}
3346
3347async function findMatchingRoute(
3348 match: BuildMatch,
3349 requestPath: string,
3350 devServer: DevServer,
3351 vercelConfig: VercelConfig
3352): Promise<RouteResult | void> {
3353 const reqUrl = `/${requestPath}`;
3354 for (const buildResult of match.buildResults.values()) {
3355 if (!Array.isArray(buildResult.routes)) continue;
3356 const route = await devRouter(
3357 reqUrl,
3358 undefined,
3359 buildResult.routes,
3360 devServer,
3361 vercelConfig
3362 );
3363 if (route.found) {
3364 return route;
3365 }
3366 }
3367}
3368
3369function findAsset(
3370 match: BuildMatch,

Callers 1

shouldServeFunction · 0.70

Calls 2

devRouterFunction · 0.90
valuesMethod · 0.45

Tested by

no test coverage detected