-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adapt the middleware example for cloudflare
- Loading branch information
Showing
6 changed files
with
92 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { OpenNextConfig } from "open-next/types/open-next"; | ||
|
||
const config: OpenNextConfig = { | ||
default: { | ||
override: { | ||
wrapper: "cloudflare", | ||
converter: "edge", | ||
}, | ||
}, | ||
|
||
middleware: { | ||
external: true, | ||
override: { | ||
wrapper: "cloudflare", | ||
converter: "edge", | ||
}, | ||
}, | ||
|
||
dangerous: { | ||
disableTagCache: true, | ||
disableIncrementalCache: true, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
{ | ||
"name": "middleware", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
"lint": "next lint", | ||
"build:worker": "pnpm cloudflare", | ||
"dev:worker": "wrangler dev --port 8770 --inspector-port 9330", | ||
"preview:worker": "pnpm build:worker && pnpm dev:worker" | ||
}, | ||
"dependencies": { | ||
"next": "latest", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
"next": "catalog:", | ||
"react": "catalog:", | ||
"react-dom": "catalog:" | ||
}, | ||
"devDependencies": { | ||
"@opennextjs/cloudflare": "workspace:*", | ||
"@types/node": "18.0.0", | ||
"@types/react": "18.2.8", | ||
"@types/react-dom": "18.0.5", | ||
"eslint": "8.18.0", | ||
"eslint-config-next": "12.2.0", | ||
"typescript": "4.7.4" | ||
"@types/react": "catalog:", | ||
"@types/react-dom": "catalog:", | ||
"eslint": "catalog:", | ||
"typescript": "catalog:", | ||
"wrangler": "catalog:" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.