<br /><br />Lightweight mock server on top of <a href="https://github.com/koajs/koa">koa</a>
Installation
$ npm i refox -g
Setup
Step 1: create config file in your project root
refox.config.js
const path = ; moduleexports = port: 5000 verbose: true debug: true mock: sync: { if /sync/ return true; } { // sync return return '{ "foo": "bar" }'; } async: { if /async/ return true } { // or async callback var cb = this; ; } compile: { if /sync/ return true; } loaders: 'pug?root=' + path // find your local file { return path; } static: 'lib'
Step 2: run refox
$ refox
you can also specify config file by using
$ refox -c file.config.js
CLI
Usage: refox [options] lightweight mock server on top of koa Options: -h, --help output usage information -V, --version output the version number -c, --config <path> specify config file path -d, --debug enable debug mode
License
MIT © fengzilong