Cloudflare Pages + Qwik City

Webhook-ready workspace, stripped back to one job.

This repo is now a Qwik app with a Cloudflare adapter and a POST endpoint pattern at /api/[provider]/webhook. Use it as the thin receiver layer in front of queues, APIs, or provider-specific business logic.

Quick start

  1. npm install
  2. cp .dev.vars.example .dev.vars
  3. npm run dev

For Zalo, set ZALO_BOT_SECRET_TOKEN in .dev.vars. Generic providers can still use WEBHOOK_SECRET.

Routes

  • GET /workspace overview
  • GET /api/zalo/webhookreturns the endpoint contract for a provider
  • POST /api/zalo/webhookvalidates Zalo's secret-token header and event payload

Test the endpoint

curl -X POST http://localhost:5173/api/zalo/webhook \
  -H "content-type: application/json" \
  -H "x-bot-api-secret-token: change-me" \
  -d '{"ok":true,"result":{"event_name":"message.text.received","message":{"text":"Xin chao"}}}'