Skip to content

Commit

Permalink
Add example of how to run
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Radchenko committed Sep 16, 2015
1 parent 41cd122 commit 05cde80
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -16,6 +16,12 @@ npm install --save hapi-decorators
```

```js
/*
* index.js
*
* Hapi initialization not shown, but `server` is the assumed
* instance;
*/
import {
get,
controller
Expand All @@ -38,6 +44,12 @@ let test = new TestController('world')
server.routes(test.routes())
```

Run the above script with the following command, after installing [babel].
```no-highlight
babel-node --optional es7.decorators,es7.objectRestSpread index.js
```


## Decorators

### `@controller(basePath)`
Expand Down Expand Up @@ -82,3 +94,5 @@ Add a validation object for the different types, except for the response.
### `@cache(cacheConfig)`

Cache settings for the route config object.

[babel]: https://www.npmjs.com/package/babel

0 comments on commit 05cde80

Please sign in to comment.