Skip to content

Mock Server

Pro feature. Mock Server requires a Pro or Teams license.

The Mock Server lets you run a local HTTP server with custom response rules. It's useful for frontend development when the real API isn't ready, for testing error handling, or for demos that need to work offline.

Starting the server

Open the Mock Server screen from the left toolbar. Click Start to launch the server on localhost. The default port is 3210 — change it in the server settings before starting.

The server runs in the background while Restroom is open. Stop it with the Stop button.

Creating stubs

A stub defines a URL pattern and the response to return when that pattern matches.

Click + to add a stub. Configure:

FieldDescription
MethodHTTP method to match (GET, POST, etc., or Any)
PathURL path pattern, e.g. /users/:id
StatusHTTP status code to return
BodyResponse body — JSON, plain text, or empty
HeadersResponse headers to include
DelayArtificial delay in milliseconds

Path parameters

Use :param syntax in paths to match dynamic segments. /users/:id matches /users/1, /users/abc, etc.

Response body

The body field supports environment variables using syntax, resolved against the active environment at the time of the request.

Request log

The request log shows every request received by the mock server in real time — method, path, matched stub, and response time. Click an entry to see the full request details.

Using the mock server in requests

Point your requests at http://localhost:3210 (or whichever port you configured). Use an environment variable for the base URL so you can switch between the mock and real API by changing environments.

Released under the Restroom License.