moker

A Simple Mock REST Client for Everyone

Main Objective

Moker allows you to easily run a mock server using JSON or YAML files.

Features

Usage

  1. Clone the repository
  2. Use the cargo run command

To run the sample JSON files, use:

bash cargo run -- -s ./example/json -p 8000

Flags

JSON Configuration for Route

Response Configuration

Within the JSON body, use the "response" parameter to specify the following values: - "headers": Define a dictionary/map of headers to be included in the HTTP response. - "status_code": Set the HTTP response code. - "body": Provide the JSON or raw string you want to be returned in the HTTP response. - "delay_ms": Add a delay to the response in milliseconds.