Skip to content

Commit 9fd1afa

Browse files
committed
Convert the API example to OpenNext
1 parent 66ba743 commit 9fd1afa

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

examples/api/open-next.config.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
import type { OpenNextConfig } from "@opennextjs/aws/types/open-next";
22

33
const config: OpenNextConfig = {
4-
default: {},
4+
default: {
5+
override: {
6+
wrapper: "cloudflare-node",
7+
converter: "edge",
8+
// Unused implementation
9+
incrementalCache: "dummy",
10+
tagCache: "dummy",
11+
queue: "dummy",
12+
},
13+
},
514

615
middleware: {
716
external: true,
817
override: {
9-
wrapper: "cloudflare",
18+
wrapper: "cloudflare-edge",
1019
converter: "edge",
20+
proxyExternalRequest: "fetch",
1121
},
1222
},
1323
};

examples/api/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#:schema node_modules/wrangler/config-schema.json
22
name = "api"
3-
main = ".open-next/index.mjs"
3+
main = ".open-next/worker.ts"
44
compatibility_date = "2024-09-23"
55
compatibility_flags = ["nodejs_compat"]
66

pnpm-lock.yaml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ catalog:
2626
"tsx": ^4.19.2
2727
"typescript-eslint": ^8.7.0
2828
"vitest": ^2.1.1
29-
"wrangler": ^3.93.0
29+
"wrangler": ^3.95.0

0 commit comments

Comments
 (0)