Skip to content

Commit 7ae2067

Browse files
committed
Add simple url example
1 parent 374c9e9 commit 7ae2067

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/content/docs/pages/functions/api-reference.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ The following are the properties on the `context` object which are passed throug
6868

6969
This is the incoming [Request](/workers/runtime-apis/request/).
7070

71+
You can use this to access request parameters such as the url:
72+
73+
```js
74+
export function onRequest(context) {
75+
const url = context.request.url;
76+
const pathname = new URL(url).pathname;
77+
}
78+
```
79+
7180
- `functionPath` string
7281

7382
This is the path of the request.

0 commit comments

Comments
 (0)