Zeeshan
Zeeshan
Explore posts from servers
CDCloudflare Developers
Created by Zeeshan on 9/16/2024 in #pages-help
how to use production d1 db in local
what does that mean? asking because i'm able to fetch on a deployed url but not on local host. for context i'm using d1 with astro with the help of cloudflare adapter, so i'm able to use Astro.locals.runtime.env.CB_DB
3 replies
CDCloudflare Developers
Created by _Lumi-dev on 7/22/2024 in #general-help
404 Not found
6 replies
CDCloudflare Developers
Created by Zeeshan on 7/22/2024 in #d1-database
Hi folks. i have a bunch of data in a
No description
2 replies
DTDrizzle Team
Created by Zeeshan on 7/21/2024 in #help
i cant add more than 5-6 rows of data. is there a limit (using drizzle for d1 db)
No description
2 replies
CDCloudflare Developers
Created by Zeeshan on 7/22/2024 in #d1-database
Hi folks. i have a bunch of data in a
2 replies
CDCloudflare Developers
Created by Zeeshan on 7/18/2024 in #general-help
Can i create custom web hook with cloudflare workers?
nvm, followed this guide and got it working. basically we need to add binding. https://developers.cloudflare.com/pages/framework-guides/deploy-an-astro-site/#use-bindings-in-your-astro-application
5 replies
CDCloudflare Developers
Created by Zeeshan on 7/18/2024 in #general-help
Can i create custom web hook with cloudflare workers?
No description
5 replies
CDCloudflare Developers
Created by Zeeshan on 7/18/2024 in #general-help
Can i create custom web hook with cloudflare workers?
wow thanks, that is so cool! i asked claude and it said its possible with some example code but wanted to confirm. so, i suppose i would need to create an file inside /api folder on my astro project and write a worker script there exporting a post function. then i guess i can use it like this https://my-domain.com/api/{webhook-file-name}
export async function post({ request }) {
try {
const data = await request.json();

// Log the form submission data
console.log('Form submission received:', data);

// write sql query to insert to d1 database
// await Astro.locals.runtime.env.DB.prepare("INSERT INTO contact_form........

return new Response(JSON.stringify({ message: 'Webhook received successfully' }), {
status: 200,
headers: {
'Content-Type': 'application/json'
}
});
} catch (error) {
console.error('Error processing webhook:', error);
return new Response(JSON.stringify({ error: 'Error processing webhook' }), {
status: 500,
headers: {
'Content-Type': 'application/json'
}
});
}
}
export async function post({ request }) {
try {
const data = await request.json();

// Log the form submission data
console.log('Form submission received:', data);

// write sql query to insert to d1 database
// await Astro.locals.runtime.env.DB.prepare("INSERT INTO contact_form........

return new Response(JSON.stringify({ message: 'Webhook received successfully' }), {
status: 200,
headers: {
'Content-Type': 'application/json'
}
});
} catch (error) {
console.error('Error processing webhook:', error);
return new Response(JSON.stringify({ error: 'Error processing webhook' }), {
status: 500,
headers: {
'Content-Type': 'application/json'
}
});
}
}
Am i right?
5 replies
CDCloudflare Developers
Created by Zeeshan on 7/16/2024 in #general-help
Possibility of using email routing while email hosted elsewhere?
To add to my above reply: I use porkbun gui for managing emails apart from the porkbun hsoting, so it functions like fastmail/protonmail, etc but does these services like fastmail, zoho, etc requires setting up MX and TXT records in cloudflare? if then, what if i want to use resend or email workers which requires adding MX and TXT records? my primary use case is as follows: (related thread https://discord.com/channels/595317990191398933/1261366932238766101) (1) submit form -> (2) store the form data to d2 -> (3) send an email with the form data to myself. for the step 3, i have seen 2 ways to do this 1. use email workers https://developers.cloudflare.com/email-routing/email-workers/send-email-workers/ 2. using resend https://developers.cloudflare.com/developer-spotlight/tutorials/handle-form-submission-with-astro-resend/ while the first one requires altering existing email records, second method adds a new email records.
8 replies
CDCloudflare Developers
Created by Zeeshan on 7/16/2024 in #general-help
Possibility of using email routing while email hosted elsewhere?
yes, i purchased few email hosting that looks like email@yourdomain.com ideally, using cloudflare to host websites, where should i host email then? i didn't find a hosting service from cf.
8 replies
CDCloudflare Developers
Created by Zeeshan on 7/16/2024 in #general-help
Possibility of using email routing while email hosted elsewhere?
Oh TIL💡 So if that is the case, can i delete the existing existing MX and TXT records from CF and then use CF's email routing service to route to porkbun hosted email addresses?
8 replies
CDCloudflare Developers
Created by Zeeshan on 7/15/2024 in #general-help
Getting Error 522 on my pages project
yay, it works now. thanks a lot! 🏅
5 replies
CDCloudflare Developers
Created by Zeeshan on 7/15/2024 in #general-help
Getting Error 522 on my pages project
oh, i didnn't know i need to add it manually. let me do it and see.
5 replies
CDCloudflare Developers
Created by Zeeshan on 7/12/2024 in #general-help
transferring active domain to cf
oh cool! i will try that. i want to collect all my website form submissions to my email
7 replies
CDCloudflare Developers
Created by Zeeshan on 7/12/2024 in #general-help
transferring active domain to cf
perfect! thanks for clearing my doubt. :cloudflare: ❤️
7 replies
CDCloudflare Developers
Created by Zeeshan on 7/12/2024 in #pages-help
Want to use workers with my astro site. Deployed to CF. What's next?
2 replies
CDCloudflare Developers
Created by Zeeshan on 6/20/2024 in #next-on-pages
Has anyone got hono+nextjs+d1 working
oh gotcha thanks so much 👍
5 replies