Connecting to D1 in Cloudflare Pages #2317
Unanswered
callmetwan
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @callmetwan Updated the document for handling Bindings: https://hono.dev/getting-started/cloudflare-pages#bindings In that section, using KV, but you can use D1 with the same way. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I'm trying to build a Cloudflare Pages app using D1. I'm brand new both to Cloudflare and Hono. I'm trying to understand how to connect to D1. I'm also trying to understand how local development works between Wrangler and Vite.
D1 connection
I see this in the documentation
Where do I put the database ID? Is that supposed to go in a separate
wrangler.toml
file?Local development
I understand that Wrangler allows us to do local development of Cloudflare Workers/Pages. I understand that Vite is used to build the forntend. How are they intended to work together? When creating a Hono Cloudflare Pages project I see it creates it with these scripts:
Is it intended that both the
dev
andpreview
commands are intended to be run simultaneously? If not, how when is it appropriate to usedev
vspreview
?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions