0.1.4 • Published 4 years ago
@sprdv/hapi-inout v0.1.4
hapi-inout
Hapi plugin to log in-coming and out-going requests to console. This module is especially useful during development.
Installation
Hapi-inout can be installed using npm
or yarn
.
npm install @sprdv/hapi-inout
Usage
This plugin can be registered like any other:
'use strict';
const Hapi = require('@hapi/hapi');
const init = async () => {
const server = Hapi.server();
await server.register({
plugin: require('@sprdv/hapi-inout'),
options: {
disable: process.env.NODE_ENV === 'production'
}
});
await server.start();
console.log('Server running on %s', server.info.uri);
};
init();
Options
The following options are available:
- disable: disable the plugin (defaults to
false
).