Mock multiple (micro-)services with Docker boxes and gateway with Kong.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
test
.eslintignore
.eslintrc
.gitignore
.npmignore
.travis.yml
History.md
LICENSE
Makefile
README.md
index.js
package.json
yarn.lock

README.md

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(...);