diff --git a/src/content/docs/workers/framework-guides/web-apps/react-router.mdx b/src/content/docs/workers/framework-guides/web-apps/react-router.mdx index 307a38d7a866ffc..1c80882299fab32 100644 --- a/src/content/docs/workers/framework-guides/web-apps/react-router.mdx +++ b/src/content/docs/workers/framework-guides/web-apps/react-router.mdx @@ -198,44 +198,4 @@ As you have direct access to your Worker entry file (`workers/app.ts`), you can -### Static assets - -By default, the Remix template for Cloudflare Pages Functions does not handle static assets, but you can configure it to do so. - -First, configure your `wrangler.toml` file to serve a directory. - -```toml title="wrangler.toml" -[[d1_databases]] -binding = "DB" -database_name = "remix-app" -database_id = "" - -[[r2_buckets]] -binding = "MY_BUCKET" -bucket_name = "my-bucket" - -[site] -bucket = "./public" -``` - -Then, you must modify your server handler to serve static assets from that directory. - -```ts title="functions/[[path]].ts" -import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages"; -import { type Env } from "../app/lib/env"; - -// @ts-ignore -import * as build from "../build"; - -export const onRequest = createPagesFunctionHandler({ - build, - getLoadContext: (context) => ({ - cloudflare: { - ...context, - env: { ...context.env, ASSETS: undefined }, - }, - }), -}); -``` -