mockit-sw
v0.1.4
Published
Mock server in your browser.
Downloads
13
Readme
mockit
Mock server in your browser.
Install
npm install mockit-sw --save-dev
Config
Create a file named mockit.config.js
. An example is provided below:
// mockit.config.js
module.exports = {
'GET /api/pubs/:pubid': {
type: 'object',
properties: {
id: { type: 'string', format: 'uuid' },
name: { type: 'string', format: 'name' },
description: { type: 'string', format: 'lorem' }
}
},
'POST /api/pubs': {
type: 'object',
properties: {
status: { type: 'boolean' },
created_id: { type: 'string', format: 'uuid' }
}
}
};
Run
Add a script to your package.json file.
// part of package.json { "scripts": { "mock": "mockit" } }
Just run
npm run mock
.