Sharing your mock API files


 Sharing a mock API

Each file can be easily shared with other Mockoon's users, "as-is". After locating your environment file, you can share it with your coworkers by using Git for example. You coworkers can then save the file in any folder and open it directly using the "Open environment" button:

open an environment

 Use a Git-tracked folder

You can save your environment data files in a Git-tracked folder to make sharing easier. By default, an environment file JSON content is saved pretty-printed to allow comparing changes between two commits. You can disable pretty printing in the settings:

disable pretty printing

 Use a mock API with the CLI

The CLI is directly compatible with environment files. After locating your environment file, you run them with the CLI using the following command: mockoon-cli start -d ./path-to-file/environment-data-file.json.

 Share JSON setups using the clipboard

Mockoon allows you to easily copy an environment or a route's JSON configuration to the clipboard and create a new environment or route from the clipboard's data.

 Copy an environment or a route JSON to the clipboard

To copy a specific environment or route's JSON data to the clipboard, right-click on the environment or route and select Copy to clipboard (JSON):

Right click on an environment and click on Copy to clipboard (JSON)

The resulting JSON can be saved in a file and directly opened in the desktop app or used with the CLI.

 Create a new environment from clipboard's data

To create a new environment from data present in the clipboard, open the File menu and select New environment from clipboard:

Create new environment from clipboard

You will be prompted to choose a save location for your new environment.

 Create a new route from clipboard's data

To create a new route from data present in the clipboard, open the Routes menu and select Add route from clipboard:

Create new route from clipboard

The new route will be added to your active environment's routes.