Utility for getting and setting the values of cookies.
The current locale computed from the URL of the request. It matches the locales in i18n.locales, and returns undefined otherwise.
Get action result on the server when using a form POST.
Object accessed via Astro middleware
Route parameters for this request if this is a dynamic route.
The current locale that is computed from the Accept-Language header of the browser (SSR Only).
The list of locales computed from the Accept-Language header of the browser, sorted by quality value (SSR Only).
List of props returned for this path by getStaticPaths (Static Only).
Information about the current request. This is a standard Request object
A full URL object of the request URL.
Redirect to another page (SSR Only).
Optional status: ValidRedirectStatusIt rewrites to another page. As opposed to redirects, the URL won't change, and Astro will render the HTML emitted by the rerouted URL passed as argument.
if (pageIsNotEnabled) {
return Astro.rewrite('/fallback-page')
}
The address (usually IP address) of the user.
Throws an error if used within a static site, or within a prerendered page.