npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

nodejs-mock-server

0.0.14 • Public • Published

nodejs-mock-server

A dev mock server for nodejs project, focus on improving development efficiency

Getting Started

1. Install npm package:

$ npm install nodejs-mock-server --save-dev

2. Init mock-server:

// 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

3. Visit /mock-server/#/

Usage Example

Guide && Schematic Diagram

TODO List

  • dev server

  • request/response intercept

  • guide && schematic diagram

  • add mock feature with mockjs

install

npm i nodejs-mock-server

Downloadsweekly downloads

1

version

0.0.14

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability