0.6.0 • Published 10 years ago

hapi-auto-loader v0.6.0

Weekly downloads
33
License
-
Repository
github
Last release
10 years ago

hapi-auto-loader

Automatically loads server methods, routes, views, helpers.

Usage

See example directory for a full project.

server.register({
  register: require('hapi-auto-loader'),
  options: {
    cwd: path.join(process.cwd(), 'example')
  }
}, function (err) {
  //code
});

For running again

require('hapi-auto-loader')(server, options, next);

If you need to disable a loader, set the value to false.

require('hapi-auto-loader')(server, {
  routes: false
}, next);

Configuring routes:

require('hapi-auto-loader')(server, {
  routes: {
    base: '/cats/',
    context: {
      kitten: 'Mew'
    },
  }
}, next);

Routes in sub-directories can use the directory structure as the url path simply by not including a slash in the beginning of the path. See: example/routes/api

0.6.0

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago