useRequestEvent
Within the Nuxt context you can use useRequestEvent to access the incoming request.
// Get underlying request event
const event = useRequestEvent()
// Get the URL
const url = event?.path
::tip
In the browser, useRequestEvent will return undefined.
::