Skip to content

Commit dcf31ea

Browse files
committed
add vercel support
1 parent 3651e95 commit dcf31ea

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ dist
88
.output
99
.cache
1010
.env
11+
.vercel

nitro.config.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineNitroConfig } from "nitropack/config";
2+
import { provider } from "std-env";
23

34
export default defineNitroConfig({
45
compatibilityDate: "2025-07-23",
@@ -14,10 +15,16 @@ export default defineNitroConfig({
1415
"/user/find/**": { proxy: "/users/find/**" },
1516
},
1617
storage: {
17-
"/cache/gh": {
18-
driver: "cloudflare-kv-binding",
19-
binding: "UNGH_CACHE",
20-
},
18+
"/cache/gh":
19+
provider === "vercel"
20+
? {
21+
// UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN are used by default
22+
driver: "upstash",
23+
}
24+
: {
25+
driver: "cloudflare-kv-binding",
26+
binding: "UNGH_CACHE",
27+
},
2128
},
2229
devStorage: {
2330
"/cache/gh": {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"eslint-config-unjs": "^0.5.0",
1717
"nitropack": "^2.12.4",
1818
"prettier": "^3.6.2",
19+
"std-env": "^3.9.0",
1920
"typescript": "^5.8.3"
2021
},
2122
"packageManager": "pnpm@10.13.1"

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)