Path: blob/master/webhooks/stream-parkpow-webhook-worker/README.md
1093 views
Stream → ParkPow Webhook Proxy (Cloudflare Worker)
Cloudflare Worker that acts as a proxy for forwarding webhooks from Hertz's Stream to ParkPow system.
Development
1. Install Dependencies
2. Configure Environment Variables
Set the following in your wrangler.jsonc:
3. Development
Start a local worker:
4. TDD
Run the test suite (watch mode):
5. Deployment
Deploy to Cloudflare Workers:
Edit the secrets on cloudlflare dashboard or use:
6. Testing
Use the webhook with stream:
How It Works
Incoming Request: The worker listens for POST requests from Stream.
Authentication: Validates the
Authorizationheader againstSTREAM_TOKEN.Forwarding: Forwards the request to ParkPow, replacing the authorization header with
PARKPOW_TOKEN.Multipart Support: Handles both JSON and multipart/form-data bodies, preserving binary data integrity.
Error Handling: Returns clear error responses for authentication failures, missing configuration, or network issues.
📦 Tooling & Configuration
biome.json: Code formatting and linting.
tsconfig.json: TypeScript configuration.
vitest.config.mts: Vitest setup for Cloudflare Workers.
wrangler.jsonc: Cloudflare deployment config.
.vscode/settings.json: Editor enhancements.