-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Clarkie
committed
Jul 24, 2014
1 parent
b51586f
commit b1300bb
Showing
1 changed file
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,55 @@ | ||
hapi-route-directory | ||
==================== | ||
|
||
Hapi route directory | ||
Provides a route directory for your hapi application. | ||
``` | ||
{ | ||
"methods": { | ||
"GET": [ | ||
"/accounts", | ||
"/accounts/{id}", | ||
"/api" | ||
], | ||
"POST": [ | ||
"/accounts" | ||
], | ||
"PUT": [ | ||
"/accounts/{id}" | ||
], | ||
"DELETE": [ | ||
"/accounts/{id}" | ||
] | ||
}, | ||
"paths": [ | ||
{ | ||
"/accounts": [ | ||
"GET", | ||
"POST" | ||
] | ||
}, | ||
{ | ||
"/accounts/{id}": [ | ||
"GET", | ||
"PUT", | ||
"DELETE" | ||
] | ||
}, | ||
{ | ||
"/api": [ | ||
"GET" | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
# Usage | ||
|
||
``` | ||
server.pack.register({ plugin: require('hapi-route-directory'), options: {path:'/api'}}, function(err, a){ | ||
if (err) throw err; | ||
} ); | ||
``` | ||
## Options | ||
### path | ||
This defines the route where you'd like to put your api directory (default = '/') |