Where to write Cloudflare workers functions in an Astro project?
I'm working on an e-commerce project and am trying to integrate Stripe. Where would you place a server-side endpoint in an Astro project? Does this require the astro/cloudflare adapter? The project is local.
This is the type of code that needs to run on the server:
import Stripe from 'stripe';const stripe = new Stripe('sk_test_...');const customer = await stripe.customers.create({ email: 'customer@example.com',});console.log(customer.id);
import Stripe from 'stripe';const stripe = new Stripe('sk_test_...');const customer = await stripe.customers.create({ email: 'customer@example.com',});console.log(customer.id);