josh028126
josh028126
CDCloudflare Developers
Created by josh028126 on 3/12/2024 in #general-help
Trying to figure out D1/Worker/Page Issue
I ran a buid command locally to see what was contained within the /dist. I've tried both 'advanced' and 'directory' mode on my astro.config.mjs and neither one brings in my functions which I have created within the /functions root folder.
11 replies
CDCloudflare Developers
Created by josh028126 on 3/12/2024 in #general-help
Trying to figure out D1/Worker/Page Issue
which, I get why this woudln't work locally. But I would imagine it would/should work within CF once I do a git commit and the deployment/build is done. I'm probably missing something simple.
11 replies
CDCloudflare Developers
Created by josh028126 on 3/12/2024 in #general-help
Trying to figure out D1/Worker/Page Issue
I think I know what's wrong, but I don't yet know how to fix it. I'm authenitcated to CF via the wrangler CLI. So when interfacing with http://localhost:8787/api/signup it works fine. I tried sending the same data I was using in Postman from my Astro webapp targeting http://localhost:8787/api/signup but I get the CORS error. I am thinking that my webapp has no idea how to interface with the D1 environment.
11 replies
CDCloudflare Developers
Created by josh028126 on 3/12/2024 in #general-help
Trying to figure out D1/Worker/Page Issue
local dev instance (http://localhost:8787/api/signup) which is via wrangler. Yes I have it for both preview and production.
11 replies
CDCloudflare Developers
Created by josh028126 on 3/12/2024 in #general-help
Trying to figure out D1/Worker/Page Issue
I guess I'm confused as to whether or not I need to have a service binding, and/or use a separate worker altogether, or if I can do everything I aim to with just a single Page instance and a function with the D1 bindings. It works via wrangler CLI and using postman, just not from my webapp locally or from the CF page. Wondering if it's maybe CORS or something else?
11 replies
CDCloudflare Developers
Created by josh028126 on 3/12/2024 in #general-help
Trying to figure out D1/Worker/Page Issue
Hi @Cyb3r-Jok3 - yeah, in the page settings > functions > D1 database bindings it's configured there.
11 replies