Config-driven edge routing on Cloudflare Workers.

One Worker in front of your backends. Routes live in KV, so changing them needs no redeploy. Built with Hono, streaming by default, running on Cloudflare's edge.

Get startedView on GitHub

What it does

Prefix routing

First match wins. Query strings are kept and the prefix is stripped before forwarding.

Load balancing

Several targets per route with a weighted pick, failover for GET and HEAD, and a per-route circuit breaker.

HMAC signing

Optional request signing so backends can reject traffic that did not come through the Worker, with key rotation.

Edge cache and limits

Optional caching of GET responses and per-IP rate limiting.

Never waits on KV

Config is cached in memory and refreshed in the background (stale-while-revalidate).

Observable

Streaming bodies, a 120 s default timeout, generic JSON errors with a request ID, structured logs and optional Analytics Engine metrics.

Quick start

git clone https://github.com/KalpataruLab/edgeroute.git
cd edgeroute
pnpm install
pnpm run dev      # http://localhost:8787
pnpm test

Copy config.example.json to config.json, edit the routes and upload it to KV. Use https:// domain names for targets, and put specific prefixes first.

Documentation

OperationsKV setup, secrets, deploy, rollback Configurationroute and config format Load balancingweights, failover, circuit breaker Key rotationHMAC signing keys Edge cachecaching GET responses MetricsAnalytics Engine Architecturehow a request flows