x-mocks

Dynamic multiple mock server

Usage no npm install needed!

<script type="module">
  import xMocks from 'https://cdn.skypack.dev/x-mocks';
</script>

README

x-mocks

Dynamic multiple mock server

NPM

Build Status

Basic usage

Install the package:

npm install -g x-mocks

Create a new directory:

mkdir x-mocks-example && cd x-mocks-example

Create a JSON file (e.g. first-example.json) containing:

{  
  "uri":"/v1/example",
  "method":"get",
  "response":{  
    "status":200,
    "body":"It works!"
  }
}

Run:

x-mocks .

It's done:

Access http://localhost:3000/routes to list all registered routes,

and http://localhost:3000/v1/example to see our first example.