3.1.2 • Published 3 years ago

hapi-method-loader v3.1.2

Weekly downloads
24
License
MIT
Repository
-
Last release
3 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

3 years ago

3.1.1

5 years ago

3.1.0

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.5

8 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago