Skip to content

Commit ad17f62

Browse files
authored
Delete unrelated pages configuration in react-router docs
Removed section on handling static assets in Remix template for Cloudflare Pages Functions.
1 parent a660f36 commit ad17f62

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

src/content/docs/workers/framework-guides/web-apps/react-router.mdx

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -198,44 +198,4 @@ As you have direct access to your Worker entry file (`workers/app.ts`), you can
198198
199199
</Details>
200200
201-
### Static assets
202-
203-
By default, the Remix template for Cloudflare Pages Functions does not handle static assets, but you can configure it to do so.
204-
205-
First, configure your `wrangler.toml` file to serve a directory.
206-
207-
```toml title="wrangler.toml"
208-
[[d1_databases]]
209-
binding = "DB"
210-
database_name = "remix-app"
211-
database_id = "<YOUR_DATABASE_ID>"
212-
213-
[[r2_buckets]]
214-
binding = "MY_BUCKET"
215-
bucket_name = "my-bucket"
216-
217-
[site]
218-
bucket = "./public"
219-
```
220-
221-
Then, you must modify your server handler to serve static assets from that directory.
222-
223-
```ts title="functions/[[path]].ts"
224-
import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages";
225-
import { type Env } from "../app/lib/env";
226-
227-
// @ts-ignore
228-
import * as build from "../build";
229-
230-
export const onRequest = createPagesFunctionHandler<Env>({
231-
build,
232-
getLoadContext: (context) => ({
233-
cloudflare: {
234-
...context,
235-
env: { ...context.env, ASSETS: undefined },
236-
},
237-
}),
238-
});
239-
```
240-
241201
<Render file="frameworks-bindings" product="workers" />

0 commit comments

Comments
 (0)