Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/start-api-routes/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ export const defaultAPIFileRouteHandler: StartAPIHandlerCallback = async ({
return new Response('Not found', { status: 404 })
}

// Writing the matched route path to the request allows observability tools to group requests by the parameterized route.
Object.defineProperty(request, '_matchedRoutePath', {
value: match.routePath,
writable: true,
configurable: true,
})

// The action is the route file that we need to import
// which contains the possible handlers for the incoming request
let action: APIRouteReturnType | undefined = undefined
Expand Down