Skip to content

Quick start

The goal of this page is not to install a binary — it is to watch a response change. Under a minute, four steps.

Terminal window
npm i -g laqi@2
laqi init

laqi init writes a laqi/ folder with a small todos API — GET /todos, POST /todos, POST /auth/login — each endpoint carrying named responses (ok, empty, error, …) and three ready-made scenarios: offline, logged-out, and empty-state.

Already have a contract? Skip the scaffold and write your own file — see Mock files — or import an OpenAPI document.

Terminal window
laqi

That serves the folder at http://127.0.0.1:8000 and opens the control panel at http://127.0.0.1:8000/__laqi. (laqi start is the same command, spelled out.) The folder is watched: edit a file and the server picks it up, no restart.

Change one base URL — nothing else in your app:

.env.local
VITE_API_URL=http://127.0.0.1:8000

No frontend handy? curl proves the same thing:

Terminal window
curl http://127.0.0.1:8000/todos

Open http://127.0.0.1:8000/__laqi, find GET /todos, and click empty. Request again — the list is empty. Click error — it fails with a 500. Your frontend just met two states the real backend would have made you wait for.

That is the whole product in one motion: a local API you control, and a panel that puts any endpoint in any state.