0.2.3 • Published 8 years ago
restmock v0.2.3
restmock
Mock REST response on Server or Browser.
Server Mock
It can create a quick REST server by specifying routes in a json configuration file, additionally supporting static path.
restmock configure file : default mock.json
Browser Mock
It replaces window.XMLHttpRequest, and load mock.json in target project as configuration.
- only support browserify bundling
- steps
- $ npm install restmock
- write mock.json in root of target project
- add require('restmock') to project main file
- you have to remove require('restmock') in production environment.
Configuration
It supports all express method, with more specifically following route type
- get
- post
- patch
- put
- delete
- static : create a static folder with response as target folder