Mock Server - amitsri/rostyman-releases GitHub Wiki
Mock Server
Create local mock API servers to simulate backend responses for development and testing.
Creating a Mock Server
- Click the Mock Server icon in the sidebar
- Click New Mock Server or open the Mock Server tab
- Configure routes, then click Start
Features
Routes
- Configure routes with method, path, status code, headers, and response body
- Regex path matching supported
- Delay simulation (ms)
- Toggle routes active/inactive
Save / Save As
- Save — persist the mock server config to database
- Save As — create a copy with a new name
- Configs shown in sidebar even when server is stopped
Variables
Mock server response bodies support template variables:
| Variable | Source |
|---|---|
{{variableName}} |
Mock server's own variables |
{{envVar}} |
Active environment variables |
{{globalVar}} |
Global variables |
{{vaultSecret}} |
Vault secrets |
{{$uuid}} |
Random UUID |
{{$timestamp}} |
Current timestamp |
{{$isoTimestamp}} |
ISO date string |
{{$randomInt}} |
Random integer |
{{$randomFloat}} |
Random float |
{{$randomBool}} |
Random boolean |
{{req.params.x}} |
URL path parameters |
{{req.query.x}} |
Query string parameters |
{{req.body.x}} |
Request body fields |
{{req.headers.x}} |
Request headers |
Environment Selector
Pick any environment from any collection to use in variable resolution.
LAN Access
- Enable "Allow LAN access" to bind to all network interfaces (0.0.0.0)
- LAN URL displayed (e.g.,
http://192.168.1.5:3100) for teammates - Default: localhost only for security
Port Configuration
- Specify a custom port or leave empty for auto-assign (3100-3200 range)
Sidebar
- Start/Stop from sidebar
- Right-click or kebab menu: Open, Start/Stop, Rename, Duplicate, Delete
- Search and filter
- Favourite (star) to pin to top
- Delete goes to Trash (restorable)