diff --git a/src/content/docs/pages/functions/api-reference.mdx b/src/content/docs/pages/functions/api-reference.mdx index 3f791768b383e44..d55b518f3d3b8c0 100644 --- a/src/content/docs/pages/functions/api-reference.mdx +++ b/src/content/docs/pages/functions/api-reference.mdx @@ -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. @@ -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.