From 374c9e941a9a7644a528672d6d3b08909af882cc Mon Sep 17 00:00:00 2001 From: Owen <64725743+Ownwn@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:51:15 +1200 Subject: [PATCH 1/2] Add bindings link --- src/content/docs/pages/functions/api-reference.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/pages/functions/api-reference.mdx b/src/content/docs/pages/functions/api-reference.mdx index 3f791768b383e4..ab84188cb99850 100644 --- a/src/content/docs/pages/functions/api-reference.mdx +++ b/src/content/docs/pages/functions/api-reference.mdx @@ -112,4 +112,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. From 7ae206733ac8af1f3dda9404d528697389bcf6dc Mon Sep 17 00:00:00 2001 From: Owen <64725743+Ownwn@users.noreply.github.com> Date: Tue, 17 Jun 2025 18:51:30 +1200 Subject: [PATCH 2/2] Add simple url example --- src/content/docs/pages/functions/api-reference.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/content/docs/pages/functions/api-reference.mdx b/src/content/docs/pages/functions/api-reference.mdx index ab84188cb99850..d55b518f3d3b8c 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.