hapi-dummy
v1.0.0
Published
Create a dummy hapi server that only registers one or more plugins. Great for testing
Downloads
3
Readme
hapi-dummy
Creates a simple hapi server for testing, that registers one or more plugins.
Examples
One module
const dh = require('hapi-dummy');
dh(require('hapi-forest')).then(server => {
console.log(server);
});
Module with options
dh({
require('hapi-swagger'),
options: {
info: 'test api',
version: '1.0.0',
}
}).then(server => {
console.log(server);
});
Multiple plugins
dh([
require('hapi-forest'),
{
require('hapi-swagger'),
options: {
info: 'test api',
version: '1.0.0',
}
}
]).then(server => {
console.log(server);
});
With hapi debug mode enabled
dh(require('hapi-forest'), true).then(server => {
console.log(server);
});