Mock only what matters
Define named scenarios for specific routes. Everything else goes straight to your real API — no full-blown mock server needed.
npm i -g @bvbmz/local-proxyMock 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.
{ "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.