Index of every page on this site: llms.txt

getNitroOrigin()

A utility function to get the Nitro origin from the request headers.

This is a replacement for useRequestOrigin() which has edge-cases issues in development, prerendering and in some runtime environments.

The nitro origin acts as the canonical origin for the site when you have not provided a url.

Usage

import { getNitroOrigin } from '#site-config/app'

const origin = getNitroOrigin()
// https://www.example.com/
Was this page helpful?