Self-hosting
The router is a Fetch handler. Cloudflare Workers is the default deployment target for x402-router.wgw.lol, but the package is not tied to Cloudflare.
import { createX402Router } from "@tunnckocore/x402-router";
const handler = createX402Router();
export default { fetch(request: Request) { return handler.fetch(request); },};Runtime requirements
Section titled “Runtime requirements”- Standard
RequestandResponse. fetchfor upstream facilitator calls.- No database.
- No router-side secrets.
Use createX402Router({ upstreams }) if you want to add or replace facilitators.
Health checks
Section titled “Health checks”GET /healthGET /healthzBoth return a small JSON health response from the router package.