hapi-recursive-route

0.3.0 • Public • Published

Hapi Recursive Route

Add routes recursively to your project. Never blame yourself to forget to add one route again!

Example

'use string';
 
const Hapi  = require('hapi');
const server = new Hapi.Server();
const debug = require('debug')('startup')
 
server.connection({port:3000, host:'localhost'});
 
server.register({
    register:require('hapi-recursive-route'),
    options:{
        dir:`${__dirname}/routes`
    }
}, (err) => {
    if(err){
        debug('Error');
        return;
    }
 
    server.start( (err) => {
        if(err){
            throw err;
        }
        debug(`Server running at: ${server.info.uri}`);
    });
});
 

Package Sidebar

Install

npm i hapi-recursive-route

Weekly Downloads

1

Version

0.3.0

License

ISC

Last publish

Collaborators

  • provtechsoftware