3.1.2 • Published 5 years ago

hapi-method-loader v3.1.2

Weekly downloads
24
License
MIT
Repository
-
Last release
5 years ago

hapi-method-loader Build Status

Automatically loads methods from a directory.

Installation

npm install hapi-method-loader

Usage

server.register({
  register: require('hapi-method-loader'),
  // options: {}
});

Options

  • cwd - Defaults to process.cwd()
  • methods - Relative to cwd. Defaults to methods

Methods

Each method should be a file in the methods directory. Sub directories may be used for nested methods. File name will dictate method name.

Each method should export a method function and optionally an options object.

Example:

module.exports = {
  method: function(next) {
    return next(null, new Date());
  },
  options: {
    cache: {
      expiresIn: 60 * 60 * 1000
    },
    generateKey: function() {
      return 'getTimeExample';
    }
  }
};
3.1.2

5 years ago

3.1.1

7 years ago

3.1.0

7 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.0

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago