create-cloudflare
package, and lead you through setup. C3 will also install Wrangler in projects by default, which helps us testing and deploying the application.
src/index.ts
file with the code below:
UPSTASH_KAFKA_REST_URL
, UPSTASH_KAFKA_REST_USERNAME
and UPSTASH_KAFKA_REST_PASSWORD
credentials to your wrangler.toml
as below.
npx wrangler dev
Deploy your function to Cloudflare with npx wrangler deploy
Once the deployment is done, the endpoint of the function will be provided to you.
You can check if logs are collected in Kafka by copying the curl
expression from the console: