hapi-auto-routes
hapi-auto-routes allows you to automatically register all routes from matching files.
Installation
npm install hapi-auto-routes --save
Usage
server.js
const Hapi = const server = const routes = server; //Register all routes from files matching pattern *.route.jsroutes; serverstart { if err throw err; console;};
index.route.js
const helloOne = method: 'GET' path: '/hello-one' config: { return } ; const helloTwo = method: 'GET' path: '/hello-two' config: { return } ; moduleexports = helloOne helloTwo
inspired by Mongoload