Skip to content

nbalduzzi/fastify-mongo-memory

Repository files navigation

Fastify Mongo Memory Plugin

Test Semantic Release JavaScript Style Guide semantic-release

NPM

Installation

npm install fastify-mongo-memory --save

Usage

fastify.register(require('fastify-mongo-memory'), options, err => console.error(err));

fastify.get('/', (request, reply) => {
    console.log(fastify.mongo); // Mongo in memory DB
});

Options

Mongo in memory DB configuration JSON object.

{
  "port": 5000 /* 8000 by default */
  "dbname": "database-test-name"
}

Author

Nicolás Balduzzi

License

Licensed under MIT.