Or Pages functions but yeah if you use
Or Pages functions, but yeah, if you use the adapter correctly.
13 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It doesn't need to be in the functions folder. But if you need it to be available at build time, it needs to be deployed somewhere already.
Astro Documentation
@astrojs/cloudflare
Learn how to use the @astrojs/cloudflare SSR adapter to deploy your Astro project.
This is the same as you have in Workers.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Unfortunately not, but the runtime is the same object you get in the main function of the function or the worker.
Personally, I'd just log them and you'd see all the objects on that.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
You need to run the wrangler cli pages commands with the astro dev command.
Local development · Cloudflare Pages docs
Run your Pages application locally with our Wrangler Command Line Interface (CLI).
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It will use the default, I'd personally pass through an actual db because I'm not sure if local even works on pages dev. You need to pass through them via the cli (I so want a config file!)
You need to do the former.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Ok, local works, actually...
https://developers.cloudflare.com/pages/platform/functions/bindings/#d1-databases
Bindings · Cloudflare Pages docs
A binding enables your Pages Functions to interact with resources on the Cloudflare developer platform. Use bindings to integrate your Pages Functions …