Quick Start
This guide gets you from zero to a working mock in about two minutes. You’ll need Docker installed.
-
Create a folder for your mocks.
Terminal window mkdir -p mocks && cd mocks -
Create your first mock file.
Save the following as
mocks/get_users.json:{"method": "GET","path": "/users","status": 200,"response": {"users": [{ "id": 1, "name": "Alice" },{ "id": 2, "name": "Bob" }]}} -
Start Mimic.
From the directory above
mocks/, run:Terminal window docker run -d \--name mimic \-p 8080:8080 \-v $(pwd)/mocks:/app/mocks:ro \ragilhadi/mimic:latest -
Test it.
Terminal window curl http://localhost:8080/usersYou should see your mock response.
-
Confirm Mimic is healthy.
Terminal window curl http://localhost:8080/healthThis returns
{"status":"healthy","mocks_loaded":1,"service":"mimic"}.
What just happened
Section titled “What just happened”- Docker pulled the
ragilhadi/mimic:latestimage (around 90 MB). - The
-v $(pwd)/mocks:/app/mocks:roflag mounted your localmocks/folder into the container as read-only. - Mimic scanned that folder, loaded
get_users.json, and started listening on port 8080. - Your
curlrequest matched theGET /usersmock and returned the configured response.
Try editing the file
Section titled “Try editing the file”Open mocks/get_users.json, change a name, save the file, and run curl http://localhost:8080/users again. You’ll see the new response immediately — no restart needed. This is hot reload at work.
Stop the server
Section titled “Stop the server”docker stop mimic && docker rm mimicWhere to go next
Section titled “Where to go next”- Add more mocks: see the Mock Files guide.
- Use Docker Compose for a tidier workflow: see Docker Compose deployment.
- Match on more than just method and path: see Advanced Matching.