HTTP mocks at the speed of thought.
Drop a./mocksfolder, runmoq, done. Zero config, no GUI, no fuss.
Need to mock an API quickly?
moq watches a folder of JSON files and serves them as HTTP endpoints instantly.
- ✅ Zero config — just
./mocksandmoq - ✅ Single binary —
curl -O https://moq.dev/moq-linux-amd64 - ✅ Instant setup — 5 seconds from download to running
- ✅ Smart routing —
GET-/api/users.json→GET /api/users - ✅ Dynamic params —
GET-/api/users/:id.json→GET /api/users/123 - ✅ Proxy fallback —
moq proxy https://real.api(optional) - ✅ Record mode —
moq recordcaptures real responses - ✅ Hot reload — edit JSON, auto-reload
# 1️⃣ Install (macOS/Linux)
curl -sSfL https://moq.dev/install.sh | sh
# Or download binary directly:
# https://github.com/shenald-dev/moq/releases
# 2️⃣ Create mocks folder
mkdir mocks
echo '{"users":["alice","bob"]}' > mocks/GET-/api/users.json
# 3️⃣ Run
moq
# 4️⃣ Test
curl http://localhost:3000/api/users
# → {"users":["alice","bob"]}That's it. You're mocking.
File naming: <METHOD>-<path>.json
GET-/api/users.json→GET /api/usersreturns file contentsPOST-/api/login.json→POST /api/loginreturns fileGET-/api/users/:id.json→GET /api/users/123(dynamic:id)404.json→ default 404 response (optional)
All headers, status codes supported via sibling .meta.json files (advanced).
# Proxy mode (fallback to real API)
moq proxy https://api.example.com
# Record mode (capture real responses)
moq record -o mocks/
# Custom port
moq -p 8080
# Custom mocks dir
moq -d ./test-mocks
# Hot reload disabled (production)
moq --no-reloadgit clone https://github.com/shenald-dev/moq.git
cd moq
go mod tidy
go run cmd/moq/main.go
# Run tests
go test ./...
# Build binary
go build -o moq cmd/moq/main.goMocking should be trivial.
No YAML complexity. No GUI clicks. Just files + one command.
moq is built for developers who want to ship fast and move on.
- Go — single binary, zero runtime
- chi router — lightweight, fast
- fsnotify — hot reload
- cobra — CLI
MIT — do whatever you want.
If it's useful, star it ⭐ — if not, open an issue and tell me why.
Less is more. 🧘