You could set something like that up I imagine, yes
You could set something like that up I imagine, yes


domain.com or www.domain.com), and then have the other redirect to the first. This can be accomplished with a Redirect Rule, so you won't consume a Custom Domain slot.
pages dev may read a wrangler.toml, but it shouldn't, and it will not be able to hit remote KV.wrangler kv:key put --localfoo/index.html at /foo/* itself without any url redirect.


pnpm create astro@latest # choose basic site, accept defaults
cd yourproject
pnpm run astro add cloudflare
# open astro.config.js and modify adapter line to look like this:
# adapter: cloudflare({mode: "directory"})
mkdir functions
touch functions/hello.js
# add code to hello.js
# add code to a src/pages/index.astro to call to hello function.
# maybe add a button so when you click it calls fetch('/hello')
# run project locally:
wrangler pages dev -- npm run dev
# click button and you will see the function is called successfully
# now push your project up to github. and connect cloudflare to github repo, deploy it.
# you will see that you get a 404 when it tries to fetch('/hello')