You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/1.getting-started/3.deploy.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,34 @@ You can deploy your project on your own Cloudflare account, you need to create t
24
24
You only need to create these resources if you have explicitly enabled them in the `hub` config.
25
25
::
26
26
27
+
### Recommended: generate Wrangler bindings from `hub` config
28
+
29
+
If you deploy using Wrangler (CLI or CI), you can configure Cloudflare resource IDs directly in `nuxt.config.ts` and let Nitro generate the Wrangler config during build:
30
+
31
+
```ts [nuxt.config.ts]
32
+
exportdefaultdefineNuxtConfig({
33
+
modules: ['@nuxthub/core'],
34
+
hub: {
35
+
db: 'd1:<database_id>',
36
+
blob: 'r2:<bucket_name>',
37
+
kv: 'kv:<namespace_id>',
38
+
cache: 'kv:<namespace_id>'
39
+
}
40
+
})
41
+
```
42
+
43
+
Then deploy the Nuxt output entrypoint (the Wrangler config is generated in `.output/`):
44
+
45
+
```bash
46
+
npx wrangler deploy .output/server/index.mjs
47
+
```
48
+
49
+
::note
50
+
If you are using Cloudflare Workers Builds, set your deploy command to use the built output entrypoint (not `npx wrangler deploy` from the repo root).
Then, create a [Cloudflare Workers project](https://dash.cloudflare.com/?to=/:account/workers-and-pages/create) and link your GitHub or GitLab repository.
28
56
29
57
Once your project is created, open the `Settings` tab and set:
0 commit comments