Api examples
A few API endpoints are provided as utilities:
-
/api/status
: Meant to help you debug your app and check non-sensitive environment variables on staging/production stages.
It contains a few metadata that should help you manage your app (build time, stage, region, release, etc.) -
/api/error
: Meant to help you test your server-side Sentry integration, will throw errors on purpose so you can check whether they're reporting into Sentry. -
/api/autoRedirectToLocalisedPage
: Meant to detect the browser preferred locale (based on HTTP headers) and redirect to the localised version of the page.
It is used in Next.js experimental rewrites innext.config.js
to automatically redirect to this endpoint all requests that don't have a locale defined in the url.
For instance, going to /terms should redirect to thefr
oren
page, depending on your browser language preferences.