useRequestEvent

Nuxt provides composables and utilities for first-class server-side-rendering support.


Within your pages, components, and plugins you can use useRequestEvent to access the incoming request.

// Get underlying request eventconst event = useRequestEvent()// Get the URLconst url = event.req.url