Create your own blazing fast mock server with just a JSON file!

ยท

1 min read

TLDR; github.com/Ananto30/mocker

The idea is really simple. Just create high-performing ๐Ÿš€ mock servers using a json file that maps path to status code and response body.

This can be used to benchmark your microservices, that are dependant on other HTTP services.

This is a sample mock file -

{
  "/hello/worlds": {
    "statusCode": 200,
    "responseBody": {
      "message": "Hello worlds!",
      "data" : {
        "time": "now"
      },
      "worlds": [
        "cross origin world",
        "mars world",
        "moon world"
      ]
    }
  }
}

Then just run -

./mocker -addr <YOUR_HOST_AND_PORT> -file <MOCK_JSON_FILE_LOCATION>

In windows -

mocker.exe -addr <YOUR_HOST_AND_PORT> -file <MOCK_JSON_FILE_LOCATION>

Please report bugs and suggest new features and ideas. ๐Ÿ‘‡

ย