1.0.4 • Published 7 years ago
hapi-echo-routes v1.0.4
hapi-echo-routes 
:loudspeaker: Display all routes inspired by rake routes
of Ruby on Rails
Usage
Install dependencies
npm install hapi-echo-routes
# with yarn
yarn add hapi-echo-routes
Register plugin
const Hapi = require('hapi')
const server = Hapi.server({ port: 5555 })
+ const echoRoutes = require('hapi-echo-routes')
+ server.register(echoRoutes)
Then, routes will be available with server.app.routes
:
console.log(server.app.routes)
POST /auth/login
POST /auth/register
GET /users
GET /users/{user_id}
POST /users/{user_id}
Or if you want to print to the console, just passed { debug: true}
options
server.register({
plugin: echoRoutes,
options: {
debug: true
}
})
That's it \m/\m/