Skip to content

Commit

Permalink
Let web vitals route handle all requests under that path (#11120)
Browse files Browse the repository at this point in the history
  • Loading branch information
delucis committed May 23, 2024
1 parent 9566fa0 commit 9a0e94b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/three-bikes-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/web-vitals": patch
---

Fixes requests to the web vitals endpoint in setups like Vercel’s `trailingSlash: true` that redirect from `/web-vitals` to `/web-vitals/`
2 changes: 1 addition & 1 deletion packages/integrations/web-vitals/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function webVitals({ deprecated }: { deprecated?: boolean } = {})
// Endpoint that collects metrics and inserts them in Astro DB.
injectRoute({
entrypoint: '@astrojs/web-vitals/endpoint',
pattern: WEB_VITALS_ENDPOINT_PATH,
pattern: WEB_VITALS_ENDPOINT_PATH + '/[...any]',
prerender: false,
});
// Client-side performance measurement script.
Expand Down

0 comments on commit 9a0e94b

Please sign in to comment.