0.3.0 • Published 7 years ago

hapi-recursive-route v0.3.0

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

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}`);
	});
});