Yo, I just joined because I need to decide between workers and functions. functions seems more easy, less boiler plate. Its a gpt app with just 2-3 endpoints.
Incoming HTTP requests to a Worker are passed to the fetch() handler as a request object. To respond to the request with a response, return a Response …
doesn't look like it, no, you don't get passed context, maybe some way to hack it but I'm not too familiar with Pages Plugins, but it lets you return either a Response or a Promise<Response>. If you're doing anything like submitting the data, you should really await it so the user knows the form request really did go through
Anyone know why I'm getting 512 "Could not send your email." with the Mailchannels plugin? I believe I have my DNS record setup properly for the lockdown thing, it points to the subdomain in the "Pages & Workers Overview" on the right
You might want to reconsider mailchannels: workers-and-pages-discussions Regardless, it needs to be your pages.dev (even if using a custom domain, has to be the pages.dev of your project), it corresponds with the cf-worker header. ex: cfid=myproject.pages.dev
Hi, looking for some help with functions to help me fetch json data from a third party API.
Apologies in advanced if I have got this all wrong, I am usually just front-end but I am helping this animal rescue organisation make their webpage - and to list the animals they have for adoption we are using a third party api that needs a API secret. To hide the API secret from the client-end I went about making an express.js backend that will be hosted and the end points will simply just call the third party API with the secret, and some basic filtering queries will just be appeneded to the fetch.
As this is just a simple 'backend' I believe it would be best suited for serverless functions like on Cloudflare Pages Functions as I have migrated the static page to be hosted on Cloudflare Pages already. Would this implementation be possible in CloudFlare Pages functions. I tried looking through documentation and attempted to implement last night, would the basic functions act the same with a getRequest. I had issues with parsing the request for the queries as well as returning a proper response. An example query would be ".../listings?page=1&species=Cat"
If anyone has any examples they could point me to or any guidance I would greatly appreciate it.
Attached is an example endpoint for the express implementation.
Any plans to not bundle all functions into one worker and have a worker per function file? I understood that this is the case, but just learned recently that it is not. I really wish it would be a worker per function :/