Zeeshan
Zeeshan
Explore posts from servers
CDCloudflare Developers
Created by Zeeshan on 10/29/2024 in #general-help
issue with setting up dns records in managed domain in cloudflare
thanks
4 replies
CDCloudflare Developers
Created by Zeeshan on 9/21/2024 in #pages-help
How to get R2 to work with Astro?
no, let me deploy and test. i can do R2.get, R2.list etc in local and get results. so i asssumed R2.put can also be performed in local.
12 replies
CDCloudflare Developers
Created by Zeeshan on 9/21/2024 in #pages-help
How to get R2 to work with Astro?
No description
12 replies
CDCloudflare Developers
Created by Zeeshan on 9/21/2024 in #pages-help
How to get R2 to work with Astro?
No description
12 replies
CDCloudflare Developers
Created by Zeeshan on 9/21/2024 in #pages-help
How to get R2 to work with Astro?
i initially got it upload images to r2. it worked, but then i'm wondering what changes to break it.
12 replies
CDCloudflare Developers
Created by Zeeshan on 9/21/2024 in #pages-help
How to get R2 to work with Astro?
No description
12 replies
CDCloudflare Developers
Created by Zeeshan on 9/21/2024 in #pages-help
How to get R2 to work with Astro?
i'm testing locally and also by running a local build and then previewing it using wrangler pages dev command.
12 replies
CDCloudflare Developers
Created by Zeeshan on 9/21/2024 in #pages-help
How to get R2 to work with Astro?
this is how my wrangler.toml looks like
# wrangler.toml
name = "admin"
compatibility_date = "2024-09-09"
pages_build_output_dir = "./dist"
compatibility_flags = ["nodejs_compat_v2"]


[[r2_buckets]]
binding = "CB_BUCKET"
bucket_name = "cherry-blossom"
# wrangler.toml
name = "admin"
compatibility_date = "2024-09-09"
pages_build_output_dir = "./dist"
compatibility_flags = ["nodejs_compat_v2"]


[[r2_buckets]]
binding = "CB_BUCKET"
bucket_name = "cherry-blossom"
12 replies
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