1.0.4 • Published 5 years ago

hapi-server-plugin-helper v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

npm (scoped)

Please feel free to raise issues for any queries

import good from 'good';
import disinfect from 'disinfect';

const monitorServerOptions = {
  ops: {
    interval: 1000
  },
  reporters: {
    consoleReporter: [
      {
        module: 'good-squeeze',
        name: 'Squeeze',
        args: [
          {
            log: '*',
            response: '*'
          }
        ]
      },
      {
        module: 'good-console'
      },
      'stdout'
    ],
    httpReporter: [
      {
        module: 'good-squeeze',
        name: 'Squeeze',
        args: [
          {
            error: '*'
          }
        ]
      },
      {
        module: 'good-http',
        args: [
          /** production-url,
            { wreck: {
              headers: {}
            } }* */
        ]
      }
    ]
  }
};


const disinfectOptions = {
  disinfectQuery: true,
  disinfectParams: true,
  disinfectPayload: true
};

export { disinfectOptions, disinfect };


// In your server.js file, invoke registerPlugins method
// First argument takes server instance
// Second argument takes an array of plugins
// Third argument takes an array of options
server = await registerPlugins(
    server,
    [HapiJwtAuth, good, disinfect, currentUser],
    [{}, monitorServerOptions, disinfectOptions, currentUserOptions]
  );
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago