Skip to content

Commit

Permalink
use the new defineCloudflareConfig utility the Cloudflare get-start…
Browse files Browse the repository at this point in the history
…ed configuration step
  • Loading branch information
dario-piotrowicz committed Feb 26, 2025
1 parent 241f332 commit 572a675
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions pages/cloudflare/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,32 +81,12 @@ This step is optional since `@opennextjs/cloudflare` creates this file for you d
Add a [`open-next.config.ts`](https://opennext.js.org/aws/config) file to the root directory of your Next.js app:

```ts
import type { OpenNextConfig } from "@opennextjs/aws/types/open-next.js";
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
import cache from "@opennextjs/cloudflare/kv-cache";

const config: OpenNextConfig = {
default: {
override: {
wrapper: "cloudflare-node",
converter: "edge",
// set `incrementalCache` to "dummy" to disable KV cache
incrementalCache: async () => cache,
tagCache: "dummy",
queue: "dummy",
},
},

middleware: {
external: true,
override: {
wrapper: "cloudflare-edge",
converter: "edge",
proxyExternalRequest: "fetch",
},
},
};

export default config;
export default defineCloudflareConfig({
incrementalCache: cache,
});
```

<Callout>
Expand Down

0 comments on commit 572a675

Please sign in to comment.