Mock Servers in KeyRunner
KeyRunner supports Mock Servers, allowing teams to simulate API endpoints without needing a real backend. This is especially useful during early development, local testing, and contract-first workflows but designed with a local-first, privacy-first philosophy.
🎯 Why Use Mock Servers?
- Test client behavior before the backend is available
- Simulate edge cases or failure scenarios locally
- Enable contract-first development with OpenAPI or manual definitions
- Develop and test APIs fully offline in isolated environments
⚙️ How It Works
- Mocks are created from a saved request or flow
- You define the expected response body, status code, and optional headers
- Mock servers run locally only — no public URLs are generated
- They integrate directly with flows and variable resolution
- Access is scoped based on where the mock is created:
- Private (My Workspace): Only the creator can use the mock
- Shared Workspace: Other invited users in the workspace can also access and use the mock
- Project Level: All workspace users tied to the project can access it based on their roles
- Viewers can only view
- Editors and Admins can use and update
🛠 Creating a Mock Server
- Open the request or flow you want to mock
- Click "Create Mock"
- Provide:
- Mock Name
- Response Body (JSON, XML, text, etc.)
- Status Code (e.g. 200, 404, 500)
- Optional Headers
- Scope (Private, Shared Workspace, or Project)
- The mock is saved and becomes accessible based on its selected scope
Use the mock endpoint path in your request setup — it behaves like a live API while staying local.
🔁 Mock Server Use Cases
- Frontend development with backend dependencies mocked
- Local CI runs that require predictable API behavior
- Simulating various HTTP response scenarios
- Testing isolated components without hitting real systems
📦 Mock Server Features
- Fully local execution
- Dynamic path handling (e.g.
/users/:id
) - Role-based access depending on mock scope
- Multi-mock support per project
- Easy toggling between real and mock endpoints for flows
KeyRunner Mock Servers help you iterate faster, safer, and offline — with total control over the behavior, scope, and accessibility of your simulated APIs.