Record of using Mockoon to quickly launch REST API Stub#

Recently, I often come across situations where the actual implementation of a REST API has been delayed, or a stub I created a long time ago no longer works, or I am in a hurry to perform front-end development and integration testing. In any case, Mockoon seems useful in situations where you need a minimum of Stub right now, so I have summarized the installation steps.

Background and purpose#

  • REST implementation is implemented by a different team, REST API is not available due to development delays or problems with the provided server.

  • I urgently need a Stub that returns a response via HTTPS communication.

  • I want to have a configuration that can be migrated by simply replacing it with the URL of the production API.

  • Since the co-developers are not familiar with Python, a no-code/GUI tool is preferable.

  • Docker cannot be used (internal restrictions apply)

We adopted Mockoon as a means to meet all of these conditions.

What is Mockoon?#

Mockoon is a free tool that allows you to define a REST API Stub based on a GUI.

Features:

  • You can create REST endpoints such as GET/POST with no code.

  • Intuitive GUI operation

  • HTTPS compatible (automatic generation of self-signed certificate)

  • Response delays, headers, conditional branching, etc. can be flexibly set.

  • Settings can be exported as a JSON file and can be shared via CLI or within the team.

  • The license is MIT, so it is suitable for test use.

Installation steps (Windows environment)#

  1. For Windows, it can be installed from Microfost Store. For other OS, please refer to the official website.

  2. Start Mockoon and create a stub environment from “New environment”. When the file explorer opens, choose a file name for saving that environment. Then change the port if needed; the default is 3001. Enable “Enable HTTPS” and “Enable CORS” as necessary.

  3. Create a Stub endpoint like the one below with + Add route - Automatically creating GET/POST/PUT/DELETE operations with crud seems useful when adjusting a new API, but here we want to start up quickly with GET/POST, etc., so select “Http Route” - Specify an endpoint such as /api/test-resource - GET/POST/PUT/DELETE can be selected as the method - You can specify a fixed JSON for the response, so specify a JSON sample that is consistent with the REST team.

  4. Start the server with “Start” and check access with HTTP Example:

    curl -k http://localhost:3001/api/test-resource
    

Impressions#

I thought about flack and Fastapi as options, but I was looking for something a little more convenient in terms of prerequisite knowledge and setting up to get started quickly, and I ended up finding Mockoon. It was a great help as it was more convenient and quicker to start up than I expected. I would definitely recommend it to anyone with similar needs.

It is also attractive because it is licensed under the MIT license, so the hurdles for using it in actual projects are low. Thank you to the developers of Mockoon.

Article information

author:

Mr. Takagi

Post date:

2025-05-19