TechParadox
TechParadox
CDCloudflare Developers
Created by Alf on 8/20/2024 in #workers-help
emailing people from domain workers
I'm on the 14 day free trial but then I believe it is paid. Id recommend mailjet if you need it to be free
10 replies
CDCloudflare Developers
Created by Alf on 8/20/2024 in #workers-help
emailing people from domain workers
I found zohoflow the easiest to integrate for sending user email verification codes, I simply send a form to a weburl and it sends the email
10 replies
CDCloudflare Developers
Created by TechParadox on 8/17/2024 in #workers-help
Dynamic require of "cloudflare:workers" is not supported
I got it working, thank you. Seems like the old style was less verbose but I understand the benefits of this style as well
7 replies
CDCloudflare Developers
Created by TechParadox on 8/17/2024 in #workers-help
Dynamic require of "cloudflare:workers" is not supported
What is the best way to call the service worker? Set a binding in the .toml that includes the service workers url (ex. GEMINI = "geminiworker.techparadox.workers.dev" and fetch to env.GEMINI?
7 replies
CDCloudflare Developers
Created by TechParadox on 8/17/2024 in #workers-help
Dynamic require of "cloudflare:workers" is not supported
And in the export default I just route the request to different functions depending on what function I am trying to call from the "service worker"?
7 replies
CDCloudflare Developers
Created by TechParadox on 8/17/2024 in #workers-help
Dynamic require of "cloudflare:workers" is not supported
@Erisa I am a bit confused by this, so in the service worker I could do something like this?
async function generateCourse(...

export default {
async fetch(request, env, ctx) {
const { subject, assessment, answers, goal } = await request.json;
return await generateCourse(subject, assessment, answers, goal);
},
};
async function generateCourse(...

export default {
async fetch(request, env, ctx) {
const { subject, assessment, answers, goal } = await request.json;
return await generateCourse(subject, assessment, answers, goal);
},
};
In the main worker, how would I call the service worker? Do I no longer need the services binding in wrangler.toml, and instead just directly fetch from "service worker"?
7 replies
CDCloudflare Developers
Created by TechParadox on 8/11/2024 in #general-help
Sending email via workers with mailjet API
If I try again in future I will update here but I'm just trying to get this project completed in the next two weeks and don't have much spare time for working on my computer right now
5 replies
CDCloudflare Developers
Created by TechParadox on 8/11/2024 in #general-help
Sending email via workers with mailjet API
400 error was from the mailjet API, all it said was bad request. Mailjet support told me email sent but obviously it did not
5 replies
CDCloudflare Developers
Created by TechParadox on 8/11/2024 in #general-help
Sending email via workers with mailjet API
It just said 400 bad request, as if it isn't sending json. I gave up and ended up using zohoflow which was much easier, but I also had a problem sending json so ended up sending form data. I cut off the code because of the character limit. I don't have it anymore, thanks for the reply though.
5 replies
CDCloudflare Developers
Created by TechParadox on 8/11/2024 in #general-help
Having trouble getting session cookie to store (lucia-auth, hono, cloudflare pages/worker)
Finally figured it out! In your fetch request, even if its a POST, you must set credentials: "include", and in your cors set credentials / Access-Control-Expose-Headers to true.
4 replies
CDCloudflare Developers
Created by TechParadox on 8/11/2024 in #general-help
Having trouble getting session cookie to store (lucia-auth, hono, cloudflare pages/worker)
No description
4 replies
CDCloudflare Developers
Created by TechParadox on 8/11/2024 in #general-help
Having trouble getting session cookie to store (lucia-auth, hono, cloudflare pages/worker)
Response:
Request URL:
https://api.instructor-ai.com/users
Request Method:
POST
Status Code:
201 Created
Remote Address:
104.21.42.89:443
Referrer Policy:
strict-origin-when-cross-origin
access-control-allow-origin:
https://instructor-ai.com
alt-svc:
h3=":443"; ma=86400
cf-ray:
8b15bd939978236a-EWR
content-length:
124

content-type:
application/json; charset=UTF-8
date:
Sun, 11 Aug 2024 05:14:13 GMT
nel:
{"success_fraction":0,"report_to":"cf-nel","max_age":604800}
report-to:
{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=he4L8jEVsb3Vf5PmVcS7RZah0TzzJUqAIz9H%2B%2F9ZfkiE9kEqafKclldHOS%2BnrA%2F5tjJ%2Bffy2MBCXfEMr%2FtcAxyPpS9GmwY06OBQpLZMz1g0jy5zdTy0y1z26ROaHpZkd83lVpGSYYG8%3D"}],"group":"cf-nel","max_age":604800}
server:
cloudflare
set-cookie:
auth_session=iexwez2e2idzc726kqnqob5tb5hrbndycaj74uce; Domain=instructor-ai.com; HttpOnly; Max-Age=2592000; Path=/; SameSite=Strict; Secure
Request URL:
https://api.instructor-ai.com/users
Request Method:
POST
Status Code:
201 Created
Remote Address:
104.21.42.89:443
Referrer Policy:
strict-origin-when-cross-origin
access-control-allow-origin:
https://instructor-ai.com
alt-svc:
h3=":443"; ma=86400
cf-ray:
8b15bd939978236a-EWR
content-length:
124

content-type:
application/json; charset=UTF-8
date:
Sun, 11 Aug 2024 05:14:13 GMT
nel:
{"success_fraction":0,"report_to":"cf-nel","max_age":604800}
report-to:
{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=he4L8jEVsb3Vf5PmVcS7RZah0TzzJUqAIz9H%2B%2F9ZfkiE9kEqafKclldHOS%2BnrA%2F5tjJ%2Bffy2MBCXfEMr%2FtcAxyPpS9GmwY06OBQpLZMz1g0jy5zdTy0y1z26ROaHpZkd83lVpGSYYG8%3D"}],"group":"cf-nel","max_age":604800}
server:
cloudflare
set-cookie:
auth_session=iexwez2e2idzc726kqnqob5tb5hrbndycaj74uce; Domain=instructor-ai.com; HttpOnly; Max-Age=2592000; Path=/; SameSite=Strict; Secure
4 replies