A dev mock server for nodejs project, focus on improving development efficiency
$ npm install nodejs-mock-server --save-dev
// Boot
const express = require('express')
require('nodejs-mock-server')
const app = express()
// init mock-server
MS.init({
app,
appDir: __dirname
})
// add intercept
app.use('/api/*', MS.intercept())
demo: nodejs-simple-demo
-
dev server
-
request/response intercept
-
guide && schematic diagram
-
add mock feature with mockjs