Mockintosh is an open-source tool for the service virtualization of microservices or service-oriented architecture (SOA) based services in the cloud-native platforms Docker, Kubernetes, and Amazon ECS. It is simple, lightweight and controllable, and has minimal footprint. Mockintosh supports the HTTP transport protocol and the JSON schema structure of configuration files. Learn more aboutMockintoshhere. Let's see how to install Mockintosh on a Windows computer.

Mockintosh Installation Instructions

  1. Download Python 3.x+ from here.
  2. Run "pip3 install mockintosh" from the command prompt. (Run the "python.exe -m pip install --upgrade pip" command, if prompted).

The installation instructions for the Docker variant of Mockintosh are available here.

Running Mockintosh from the Command Line

Mockintosh operates with configuration files. To start Mockintosh server, create a simple YAML file with the name simple.yaml , place this file in the path 'C:\Users\username', and run the command mockintosh simple.yaml from windows command prompt.

Example content of simple.yaml

Copy to clipboard

# simplistic example of Mockintosh configuration file
services:
  - name: Example Mock Service Config
    port: 8001
    managementRoot: __admin
    endpoints:
      - path: /
        response: hello world
Check you can see the following message to confirm that the Mockintosh server has started.
Copy to clipboard

[2021-04-25 23:49:15,419 root INFO] Mockintosh v0.8.2 is starting...
[2021-04-25 23:49:15,439 root INFO] Reading configuration file from path: my_mocks.yaml
[2021-04-25 23:49:15,445 root INFO] Configuration file is a valid YAML file.
[2021-04-25 23:49:15,449 root INFO] Configuration file is valid according to the JSON schema.
[2021-04-25 23:49:15,492 root INFO] Serving at 
Once the server is ready, you can invoke it using curl statements. The server also presents you with logging statements that will help with debugging. However, the Mockintosh server needs to be started whenever there is a change in the configuration file, unless the Management UI is used.

Running Mockintosh from the Management UI

Running Mockintosh from the Management UI

To activate the Management UI, the 'mangementRoot' property in the config file should be set to '_admin' value. Then the server needs to be started using the command line mode. See below:

Copy to clipboard

# simplistic example of Mockintosh configuration file
services:
- name: Example Mock Service Config
    port: 8001
    managementRoot: __admin
    endpoints:
    - path: /
        response: hello world

The Mockintosh Control Plane can then be accessed by accessing this URL from any browser http://localhost:8001/__admin/#config. The Management UI will look like this image:

image1

Once the Management UI is up, there is no need to start the Mockintosh server every time there is a configuration change. Instead, any change can be applied from the UI itself in real-time.

For example, if you would like to change the response value from 'hello world' to 'hello mockintosh', change the value as shown above and click on the 'Apply Changes' button. That's it. The configuration will be successfully updated.

image4

The Management UI also acts as an API tool, where you can fire a request and see the response. This open API specification is auto generated with the current configuration.

image3

That's it! You now know how to install Mockintosh on your Windows computer. To learn more about how to use Mockintosh, visit the Mockintoshwebsite or the UP9 blog.