Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/content/docs/pages/functions/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ The following are the properties on the `context` object which are passed throug

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

You can use this to access request parameters such as the url:

```js
export function onRequest(context) {
const url = context.request.url;
const pathname = new URL(url).pathname;
}
```

- `functionPath` string

This is the path of the request.
Expand Down Expand Up @@ -112,4 +121,4 @@ The following are the properties on the `context` object which are passed throug

### `EnvWithFetch`

Holds the environment variables, secrets, and bindings for a Function. This also holds the `ASSETS` binding which is how you can fallback to the asset-serving behavior.
Holds the environment variables, secrets, and [bindings](/pages/functions/bindings/) for a Function. This also holds the `ASSETS` binding which is how you can fallback to the asset-serving behavior.