Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Y-LyN-10/blipp
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-LyN-10 committed Nov 27, 2017
2 parents 8c4b863 + 842ae6d commit 9a32e0d
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions README.md
Expand Up @@ -7,32 +7,34 @@ correctly. This can be difficult to see otherwise.

![image](images/screenshot.png)

## Usage
## Usage (Hapi v17)

``` javascript
var Blipp = require('blipp');
var Hapi = require('hapi');
'use strict';

var server = new Hapi.Server();
server.connection();
const Hapi = require('hapi');
const Blipp = require('blipp');

server.route({
const server = new Hapi.Server();

const init = async () => {

await server.register(Blipp);

server.route({
method: 'GET',
path: '/somepath',
config: {
auth: 'simple',
description: 'Description to display',
handler: function (request, reply) {
// ..
}
options: {
auth: false,
description: 'Description to display',
handler: (request, h) => 'Something'
}
});
});

await server.start();
}

server.register({ register: Blipp, options: {} }, function (err) {
server.start(function () {
// ..
});
});
init();
```

## Options
Expand All @@ -59,3 +61,4 @@ With showAuth:

* 1.x = hapi 7.x
* 2.x = hapi 8.x
* 3.x = hapi 17.x

0 comments on commit 9a32e0d

Please sign in to comment.