Theme

Easy mock http servers

A no-code solution to mock http servers with a simple config.

Introduction

Getting started

Learn how to use Mimus Servce to mock an external http server.

Installation

Install the tool either in an existing project or as a CLI.

CLI

Command Line Usage

Features

Highlight the features of mimus-serve

Roadmap

Roadmap


Overview

Minus Serve is a powerful HTTP mock engine inspired by Wiremock, constructed to facilitate the creation of JSON-based mocking software. We've enriched its functionality by introducing a variety of sophisticated features that allow for effortless configuration of advanced dynamic mocking capabilities.

The core functionality of the software is based on defining mapping definitions that specify how to match incoming requests and what response to return. These mappings can be customized to fit the specific needs of the user and can be easily updated as needed. This software can be used for a variety of purposes, including building web applications, APIs, and microservices.

Core Features

  • Refined request matching techniques
  • Enhanced response templating functionalities
  • Request matching predicated on URL segments
  • Introduction of the dataset concept, enabling JSON data utilization to support CRUD operations on the data
  • Response processing using the JSONata expression language
  • Response processing utilizing the GROQ Query Language

These features allow for advanced dynamic mocking capabilities, making it easier to create JSON-based (but not only) mocking software.

Constructing a Basic File Structure

To initiate usage of Minus Serve, a basic file structure must be established within your testing project. This includes designated locations for mapping files (mandatory), served files (optional), and datasets. The specific location of these directories can be customized either through command-line parameters or a configuration file. With this structure in place, you can effortlessly configure advanced mocking capabilities and begin to mock external HTTP servers.

Sample Structure

Below is a model of a project file structure utilizing Minus Serve. It consists of a configuration.yaml file, a mappings folder to define request/response mappings, a datasets folder to hold JSON data that supports CRUD operations, and a files folder for served files. In addition, a package.json file is included with a start script that initiates Minus Serve with the configuration.yaml file.

package.json

Mimus Serve can be initiated either using the CLI or as a Node.js application. Below is an illustration of starting a mock server through a Node.js module.

You would obtain such a package.json file for your project by running npm init and then installing mimus-serve (see Installation)

configuration.yaml

Displayed below is a rudimentary configuration.yaml for a Mimus Serve mock server. It specifies the location of the mapping files, the datasets, and the files to be served.

mappings/hello-world.yaml

Mappings can be articulated in either JSON or YAML, although YAML is generally preferred. They delineate the characteristics of incoming HTTP requests and how these are to be mapped to a response.

This mapping file stipulates two mappings to serve the "Hello, world!" string. One mapping returns the string directly, while the second fetches the string from a file, enabling diverse scenarios and responses to be tested in your application.

For further details on request matching, refer to Request Matching. For comprehensive information on defining responses, see Response Templating.

To know more on how requests can be matched see . To know more on how responses can defined see Response Templating.

files/hello-world.txt