micro-mockers

0.5.0 • Public • Published

Micro Mockers

Build Status Coverage Status

Mock multiple (micro-)services with Docker boxes and gateway with Kong.

How to use

  • Always shutdown the docker boxes before you change anything
  • Download and install Docker
  • npm install -g micro-mockers
  • cd to your work directory (see test/fixture as an example)
  • mm build
  • mm up
  • mm down

Features

Mock service boxes management

TODO

Kong admin API libraries

const mm = require('micro-mockers');
const adminApi = mm.kong.adminApi;

Status can be used to ping the Admin API.

const status = new adminApi.Status('http://localhost:8001');
status.ping([max]).then(...);

Plugins can be used to ensure what in Kong matches an array of plugin definitions.

const plugins = new adminApi.Plugins('http://localhost:8001');
plugins.syncAll([{
  name: 'rate-limiting',
  config: {
    hour: 3000
  }
}, {
  name: 'syslog',
  config: {}
}]).then(...);

Apis can be used to ensure what in Kong matches an array of API definitions.

const apis = new adminApi.Apis('http://localhost:8001');
apis.syncAll([{
  name: 'lorem',
  hosts: ['...'],
  upstream_url: '...',
  plugins: [...]
}, ...]).then(...);

Dependents (0)

Package Sidebar

Install

npm i micro-mockers

Weekly Downloads

9

Version

0.5.0

License

MIT

Unpacked Size

42.2 kB

Total Files

35

Last publish

Collaborators

  • makara