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

Method getServiceRouteTable

packages/cli/src/util/dev/server.ts:1524–1549  ·  view source on GitHub ↗
(serviceName: string)

Source from the content-addressed store, hash-verified

1522 }
1523
1524 private getServiceRouteTable(serviceName: string): Route[] {
1525 if (!this.serviceRoutesTable) {
1526 this.serviceRoutesTable = new Map();
1527 for (const service of this.services || []) {
1528 if (!isExperimentalServiceV2(service)) continue;
1529
1530 const { routes, error } = getTransformedRoutes({
1531 routes: service.routes,
1532 rewrites: service.rewrites,
1533 redirects: service.redirects,
1534 headers: service.headers,
1535 cleanUrls: service.cleanUrls,
1536 trailingSlash: service.trailingSlash,
1537 });
1538 if (error) {
1539 output.warn(
1540 `Invalid routes for service "${service.name}": ${error.message}`
1541 );
1542 this.serviceRoutesTable.set(service.name, []);
1543 } else {
1544 this.serviceRoutesTable.set(service.name, routes || []);
1545 }
1546 }
1547 }
1548 return this.serviceRoutesTable.get(serviceName) || [];
1549 }
1550
1551 private async delegateToService(
1552 req: http.IncomingMessage,

Callers 1

delegateToServiceMethod · 0.95

Calls 4

getTransformedRoutesFunction · 0.90
isExperimentalServiceV2Function · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected