CaptainNemo
CDCloudflare Developers
•Created by CaptainNemo on 8/17/2024 in #pages-help
Map subdomain of main site's domain to branch deployment
I have a project at project-name.com and a branch deployment at preview.project-name.pages.dev. I'd like to make this specific branch deployment accessible via preview.project-name.com. Is that possible?
What I've tried: I added
preview.project-name.com
as a custom domain, and then modified the CNAME record to point to preview.project-name.pages.dev
instead of project-name.pages.dev
. But it still takes me to project-name.pages.dev
; I'm not seeing the preview deployment version.2 replies
CDCloudflare Developers
•Created by CaptainNemo on 4/17/2024 in #pages-help
Deploying Pages with D1 Binding via Wrangler.toml and GH Action
I've got a SvelteKit application deployed to Pages+Functions using the
@sveltekit/adapter-cloudflare
adapter and the cloudflare/pages-action
GitHub Actions action. I've confirmed that invoking API endpoints runs a Function as it should, both locally (via npm run dev
) and on prod.
I'm now trying to add a D1 database. I've added the binding to my wrangler.toml
file, and it works great locally (which is awesome 🤩), but even after deploying the schema to the remote DB via the CLI, the D1 binding in the Function does not work on my branch deploy.
I suspect this is because the pages-action
doesn't pick up the wrangler.toml
, so I tried to switch to the wrangler-action
, but I haven't figured out how to get it to deploy both the pages site and the D1 binding.
The docs suggest configuring the binding via the dashboard but I'd like to keep it in my wrangler.toml
so I have one source of truth, if possible.
The diff of the PR where I've made these changes is here: https://github.com/tylermercer/log-thing/pull/4/files/155fe21a260815b0607712ab0b51d0c627982a6d
My deployment: https://433388eb.log-thing.pages.dev/
The D1 test route showing the failed binding (which causes a 500): https://433388eb.log-thing.pages.dev/app/guestbook
Deployment ID: 433388eb-4769-41d9-9dbd-56583c4a2014
Account ID: 191456bbc4d963669ab6dd59c256d84a
10 replies