0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

Let web vitals route handle all requests under that path (#11120)

This commit is contained in:
Chris Swithinbank 2024-05-23 10:45:03 +02:00 committed by GitHub
parent 9566fa0860
commit 9a0e94b2e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/web-vitals": patch
---
Fixes requests to the web vitals endpoint in setups like Vercels `trailingSlash: true` that redirect from `/web-vitals` to `/web-vitals/`

View file

@ -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.