Skip to content

eljusto/mountebank-redis-repository

Repository files navigation

mountebank-redis-repository

Plugin for Mountebank that allows to store imposters distributedly using a Redis database.

Usage

It's recommended to create a wrapper around this plugin to pass on the configuration parameters and your own logger.

// impostersRepo.js
const repo = require('mountebank-redis-repository');
const logger = require('pino').child({ _context: 'mountebank-redis-repo' });

const repoConfig = {
  redisOptions: {
    socket: {
      host: process.env.REDIS_HOST,
      port: process.env.REDIS_PORT,
    },
    password: process.env.REDIS_PASSWORD,
  },
};

function create(config) {
  const newConfig = {
    ...config,
    impostersRepositoryConfig: repoConfig,
  };
  return repo.create(newConfig, logger);
}

module.exports = {
  create,
};

Then, run mb with the path to this file: mb --impostersRepository=./impostersRepo.js.

About

Plugin for mountebank to store imposters in Redis db

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published