Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Latest commit

 

History

History
20 lines (15 loc) · 439 Bytes

use-request-event.md

File metadata and controls

20 lines (15 loc) · 439 Bytes
title description
useRequestEvent
You can use useRequestEvent to access the incoming request.

useRequestEvent

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

// Get underlying request event
const event = useRequestEvent()

// Get the URL
const url = event.node.req.url

::alert{icon=👉} In the browser, useRequestEvent will return undefined. ::