Mocko

Mocko Docs

Dynamic HTTP mocking

GitHub ↗Mocko Cloud ↗
Overview

Getting Started

  • Getting Started

Creating Mocks

  • File Mocks
  • UI Mocks
  • Templating
  • How Matching Works
  • Flags
  • Proxying and Hosts
  • Data Blocks

Recipes

  • Overview
  • Stateful CRUD
  • List and Detail From Data
  • Append to a List
  • Mock One Edge Case
  • Simulate Slow or Unstable APIs
  • Polling Status Flow
  • Debug Broken JSON
  • Mock Microservices by Host

Testing with the SDK

  • Getting Started
  • Flag Definitions
  • Auth and Deployment

Running Mocko

  • CLI
  • Docker Compose
  • Docker Images
  • Kubernetes with Helm
  • Persistence and Redis

Reference

  • Configuration
  • CLI
  • Mock Files (HCL)
  • Template Helpers
  • Bigodon
  • Operations
  • Migrating from v1
Legacy v1 docs

Recipes

Recipes

Recipes combine mocks, templates, flags, data blocks, and proxying into complete behaviors you can copy into your project. Each one is a working mock file plus a walkthrough of the moving parts.

Stateful CRUD

A complete create, read, update, and delete API backed by flags.

List and Detail From Data

Serve a collection and a detail endpoint with 404s from one data block.

Append to a List

Accept submissions with POST and return the accumulated list with GET.

Mock One Edge Case

Proxy normal traffic to the real backend while mocking one branch.

Simulate Slow or Unstable APIs

Add latency and random failures in front of an otherwise healthy API.

Polling Status Flow

Return changing statuses for async jobs, exports, and polling UIs.

Debug Broken JSON

Track down trailing commas, empty values, and other template bugs.

Mock Microservices by Host

Stand in for several services with one instance using host blocks.

The recipes assume you know the basics from the Creating Mocks section, but each page links back to the concepts it uses, so it is safe to jump straight to the one that matches your problem.