Skip to content
local-proxy logo

Stop waiting for the backend.

Mock the endpoints you need. Proxy everything else. Ship your frontend faster.
$npm i -g @bvbmz/local-proxy
local-proxy
$ local-proxy —init
Created scenarios.json
$ local-proxy —target https://api.example.com
Local proxy running at http://localhost:5050/api

3 linesto get running
0 configto start proxying
7 methodsGET POST PUT PATCH DELETE HEAD OPTIONS

Mock only what matters

Define named scenarios for specific routes. Everything else goes straight to your real API — no full-blown mock server needed.

Switch scenarios instantly

Toggle between success, error, and edge-case responses by changing one key in your config. No code changes, no restart.

Simulate real-world latency

Add per-scenario delays to stress-test loading states, spinners, and timeouts before your users ever see them.

Use fixtures or inline JSON

Return data inline for quick tests, or point to fixture files for large, realistic payloads. Your call.

Type-safe from CLI to config

Every option is validated with Zod at runtime. Typos and bad config are caught before anything starts.

Works as a library too

Import createApp and createConfig into your own Node scripts or test harness. Full programmatic control.


# Your app calls the proxy
App → localhost:5050/api/v1/users
# Proxy checks your rules
├─ Rule matches? → Return mock scenario
└─ No match? → Forward to upstream API

{
"rules": [
{
"method": "POST",
"match": "/v1/checkout",
"enabled": true,
"active_scenario": "success",
"scenarios": {
"success": { "status": 200, "json": { "orderId": "abc-123" } },
"declined": { "status": 402, "json": { "error": "Card declined" } },
"timeout": { "status": 200, "delay": 8, "json": { "orderId": "abc-123" } }
}
}
]
}

Switch "active_scenario" to "declined" or "timeout" — no restart needed.


TypeScript Express Zod v4 Zero telemetry ISC License