Skip to main content

🧭 Quick Start

This walkthrough takes a web instance from the first visit to a working mock response. It takes about five minutes.

1. Create the account​

The first visit shows the registration form. Pick a username and a password and you are signed in right away. See Authentication if you need the details.

2. Create your first project​

A project is one mock server with its own port and its own list of expectations. Enter a name, leave the port at 8088 (or pick another free port) and, optionally, set Max request log - how many requests the project keeps.

Create your first project

You land on the Expectation page of the new project. The project is stopped at this point; the app bar shows stopped :8088.

3. Create an expectation​

Click Add Expectation in the left panel. Give it a name, an optional description and, if you like, a group.

Add expectation

The expectation is created with no matchers and no action, and it is selected on the right.

4. Add a matcher​

Click the pencil on the Matchers card, then Add matcher. A matcher has three parts: a type (method, path, header, query, param), a comparator (is, starts with, contains, â€Ļ) and a value.

Edit matchers

To match every request of the project, a single path matcher with starts with and the value / is enough. To try it on a login endpoint, use method is POST plus path is /api/login.

5. Create the action​

Click Create action on the Action card and choose the kind of action:

  • Custom response - return your own status code, headers and body. The body can be JSON, plain text, or a Mock.js template.

    Custom response action

  • Proxy - forward the request to a real host.

    Proxy action

  • Static - serve a folder from disk.

    Static action

For the quick start, keep Custom response, status 200, and type a JSON body such as:

{
"name": "John",
"role": "admin"
}

Everything is saved as you go - there is no separate save step on the page itself.

6. Start the project​

Click the green start button in the app bar. The status changes to running :8088. Now call the mock port:

curl http://localhost:8088/api/login -X POST

You get the JSON body back, and the request appears on the Request Log page.

Nothing matched?
  • If the request is answered by a 404, check that the expectation is active (the toggle in its header) and that every matcher matches - a single failing matcher is enough to skip an expectation.
  • If several expectations could match, the first one in the match order wins. See Expectation groups.

Where to go next​