Webhook development
Webhook providers need a public HTTPS URL to deliver to. routeup gives your local service one, so you can develop against real deliveries instead of mocking them.
1. Expose your local API
Section titled “1. Expose your local API”Run your API (say on port 8080) and expose it:
Configure a public server first using Exposing publicly.
routeup serve example-app --port 8080 --exposeThe examples below assume your saved token allows
*.team.routeup.dev.
routeup prints the local URL, public URL, exposure scope, and targets:
route: example-applocal: https://example-app.localhostpublic: https://example-app.team.routeup.devexpose: all pathstargets: / http://localhost:8080
requests: livepress Ctrl-C to stop2. Point the provider at it
Section titled “2. Point the provider at it”Register the public URL as the webhook endpoint in the provider’s dashboard:
GitHub: Settings → Webhooks → Payload URLStripe: Developers → Webhooks → Add endpointSlack: Your App → Event Subscriptions → Request URLUse the full path your handler listens on, e.g.
https://example-app.team.routeup.dev/api/webhooks/github.
3. Watch deliveries
Section titled “3. Watch deliveries”Tail public traffic as it arrives:
routeup logs example-app --public --followTIME ROUTE SOURCE STATUS ID METHOD DURATION PATH12:41:03 example-app public 200 req_Ap7kQ3mN8vR2xLzC POST 38ms /api/webhooks/githubBecause the route and namespace are configured, you request the same endpoint on each run instead of accepting a newly generated URL. Public claims remain subject to the server’s normal conflict rules.
4. Inspect a specific delivery
Section titled “4. Inspect a specific delivery”routeup logs shows metadata only. To see the full payload and response for a
delivery, enable capture in routeup.json:
Stop the current route owner, add this config, then restart
routeup serve --expose before sending the delivery you want to inspect.
{ "name": "example-app", "port": 8080, "capture": { "request": true, "response": true, "redact_headers": ["x-hub-signature-256", "authorization"] }}In another terminal, or after stopping the follow command, grab the request id from the log line and inspect it:
routeup inspect req_Ap7kQ3mN8vR2xLzCrouteup inspect req_Ap7kQ3mN8vR2xLzC --curlThe curl form produces a command for sending the captured request to the local
route. It includes every retained header. Signature or authorization headers
appear only when capture retained them; add them to redact_headers above when
they should not be stored or exported.
Request req_Ap7kQ3mN8vR2xLzC
Metadata--------Source: publicRoute: example-appTarget: /:8080Status: 200Duration: 38msMethod: POSTPath: /api/webhooks/githubHost: example-app.team.routeup.dev
Request-------Capture: completeBody bytes: 63Redacted: authorization, x-hub-signature-256X-Github-Event: push
Body----{ "ref": "refs/heads/main", "repository": { "full_name": "acme/api" }}
Response--------Capture: completeBody bytes: 11Redacted: authorization, x-hub-signature-256Content-Type: application/json
Body----{ "ok": true}Scoping exposure
Section titled “Scoping exposure”If you only want the webhook path reachable and the rest of the app private, you
can limit public exposure to a path prefix (for example /api/webhooks/*) so the
rest of the service stays local-only:
Restart the route owner after changing this setting.
{ "name": "example-app", "port": 8080, "expose": { "paths": ["/api/webhooks/*"] }}