node-http-mock
A HTTP mock server for node.js
Usage
Install it:
npm install node-http-mock -g
And run this command in your termial:
mock -t [api host] -p [local port] -c [config file]
Options
Run this command to see a list of all available options:
mock --help
Config
You can use config file instead of command line options:
module.exports = {
port: 5000,
verbose: true,
proxy: {
target: 'api host',
changeOrigin: true,
},
mock: {
'/path/to/to/api/1': {},
'/path/to/to/api/2': {},
},
}
License
MIT © BinRui.Guan