mostly for local development purposes. It allows you to mock your endpoints for local development and share it easily with your team.
To run it simply run:
mck
To configure it according to your requirements you can provide config.json
file in the root of your project. Created API will have a structure defined there. You can find example configuration in config/defaultConfig.json
.
If you want to have some generated data returned by the endpoint, you can set a property generateResponse
inside a particular path. This object should have following properties:
locale
- sets the locale of generated dataseed
- sets the random seed. It assured repeatable results across runs.count
- how many object should the resposne contain. If count is set to0
, resposne will contain JSON object instead of array.objectProperties
- here you can define properties of each object. Each entry is responsible for a single property.value
will be used as a name for object property.path
defines Faker API which should be used to generate target value. For examplename.lastName
will generate lastName according to Faker API.