1.0.0 • Published 9 years ago

mockk v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Mockk

Mocking server tool without dependencies for offline development made in offline.

Installation

npm i -g mockk

Usage

Create request/response mock config in mockk.conf.js file:

/*
    Template:
    {
      'URL': {
        'HTTP_METHOD': 'RESPONSE'
      }
    }

 */

'use strict';

module.exports = {

  '/': {
    'GET': 'Hello!'
  },
  '/users': {
    'POST': {
      'message': 'OK!',
      'code': '200'
    }
  },
  '/users/bob': {
    'GET': require('./user-bob')
  }
};

Run mock server:

mockk --config path/to/mockk.conf.js

or, if you are in same dir as mockk.conf.js file:

mockk