Skip to content

CLI Reference

Terminal window
local-proxy [options]
Terminal window
# typical development command
local-proxy --target https://api.example.com --port 5050
OptionDescriptionDefault
-t, --target <url>Upstream API URLRequired unless --init
-p, --port <number>Port to listen on5050
-a, --api-prefix <path>API path prefix/api
-s, --scenarios <file>Scenarios config file path./scenarios.json
--initCreate a scenarios.json template-
-h, --helpShow help-
-V, --versionShow version-
Terminal window
# basic
local-proxy --target https://api.example.com
# custom port and scenarios file
local-proxy --target https://api.example.com --port 3000 --scenarios ./mocks/scenarios.json
# custom API prefix
local-proxy --target https://api.example.com --api-prefix /backend

Use --target in every run

--target is required unless you are running only --init.

Use --scenarios for project layouts

Keep mocks in a dedicated folder like ./mocks/scenarios.json.

Use --api-prefix to align with app calls

If your app calls /backend/*, set --api-prefix /backend.