connect-mock

0.1.0 • Public • Published

connect-mock

Build status

Connect middleware for easy file-based API mocking

Usage

First, add files containing your API mock responses to a mock directory. Then, require it and call it as a function, passing options.

mock = require('connect-mock')
options = {
    mockDirectory: 'mocks/',
    verbose: false
}
middlewares.push[mock(options)]

Important: If you expect an answer from a endpoint which collides with a directory, you can use a file with the same name as the directory. See examples in mock/ folder.

Readme

Keywords

none

Package Sidebar

Install

npm i connect-mock

Weekly Downloads

9

Version

0.1.0

License

none

Last publish

Collaborators

  • gadr90
  • firstdoit