-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopen-next.config.ts
More file actions
35 lines (32 loc) · 968 Bytes
/
open-next.config.ts
File metadata and controls
35 lines (32 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineCloudflareConfig } from "@opennextjs/cloudflare";
import kvIncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/kv-incremental-cache";
import d1NextTagCache from "@opennextjs/cloudflare/overrides/tag-cache/d1-next-tag-cache";
import doQueue from "@opennextjs/cloudflare/overrides/queue/do-queue";
const incrementalCache = kvIncrementalCache;
const tagCache = d1NextTagCache;
const queue = doQueue;
const baseConfig = defineCloudflareConfig({
incrementalCache,
tagCache,
queue,
enableCacheInterception: true,
});
export default {
...baseConfig,
functions: {
apiPostsEdge: {
runtime: "edge",
placement: "global",
routes: ["app/api/posts/route"],
patterns: ["/api/posts", "/api/posts/*"],
override: {
wrapper: "cloudflare-edge",
converter: "edge",
proxyExternalRequest: "fetch",
incrementalCache,
tagCache,
queue,
},
},
},
};