Mock Server
The Mock Server lets you simulate API responses locally — no real backend required. Useful for frontend development, testing, and demos.
Opening the Mock Server Panel
Click the Mock Server icon in the sidebar, or open a saved mock server from the sidebar list.
Creating a Mock Server
- Click + New Mock Server
- Give it a name
- Set a port (or leave it empty to auto-assign from the 3100–3200 range)
- Click Start
The mock server runs on http://localhost:<port>.
Adding Routes
Each route defines how the mock server responds to a specific request:
| Field | Description |
|---|---|
| Method | GET, POST, PUT, PATCH, DELETE |
| Path | URL path — supports :param wildcards (e.g., /users/:id) |
| Status Code | Response status (e.g., 200, 201, 404) |
| Response Headers | Headers to include in the response |
| Response Body | The response payload (JSON, text, etc.) |
| Delay (ms) | Optional delay to simulate network latency |
| Active | Toggle a route on or off without deleting it |
Wildcard Paths
Use :param for path parameters:
/users/:id matches /users/1, /users/abc
/posts/:id/comments matches /posts/42/comments
Template Variables
Response bodies support dynamic template variables. Rostyman resolves them at request time:
| Variable | Source |
|---|---|
{{variableName}} | Mock server's own variables |
{{envVar}} | Active environment variables |
{{globalVar}} | Global variables |
{{vaultSecret}} | Vault secrets |
{{$uuid}} | Random UUID |
{{$timestamp}} | Current Unix timestamp (ms) |
{{$isoTimestamp}} | Current date/time in ISO 8601 |
{{$randomInt}} | Random integer |
{{$randomFloat}} | Random float |
{{$randomBool}} | Random boolean (true or false) |
{{req.params.x}} | URL path parameter named x |
{{req.query.x}} | Query string parameter named x |
{{req.body.x}} | Request body field named x |
{{req.headers.x}} | Request header named x |
Mock Server Variables
Each mock server has its own variable table — separate from environment variables. Use them for state that belongs to the mock (e.g., a counter, a default user ID).
Set variables in the Variables tab of the mock server panel.
Environment Selector
Pick any environment from any of your collections to use during variable resolution. This lets you reuse existing baseUrl, apiKey, or other environment values in your mock responses without duplicating them.
LAN Access
By default the mock server binds to localhost only. Enable Allow LAN access to bind to all network interfaces (0.0.0.0):
- The LAN URL (e.g.,
http://192.168.1.5:3001) is displayed in the panel header - Lets teammates or devices on the same network hit your mock server
- Leave disabled if you don't need external access
Request Log
The mock server logs all incoming requests in real time:
- Method, path, and matched route
- Request headers and body
- Response status and body sent
- Timestamp
Running Multiple Mock Servers
You can run several mock servers simultaneously on different ports — one per service you want to mock.
Sidebar Actions
Right-click a mock server in the sidebar for options:
- Open — switch to its tab
- Start / Stop — toggle without opening
- Rename — edit the name inline
- Duplicate — copy the server with all its routes and variables
- Favourite — pin it to the top of the sidebar list
- Delete — moves to Trash (restorable)
Save / Save As
- Save (Ctrl+S) — persist any route or variable changes to the database
- Save As — create a copy under a new name