simplecampus/hapi-pg — pull request #6 by cvan (2014-12-18 17:53:43+00:00)
Title: update compatibility for hapi v8.x.x (fixes #2)

with #3, I introduced this error with `>8.x.x` (instead of `>=8.x.x`):
```
npm ERR! notarget No compatible version found: hapi@'>=9.0.0-0'
```

after changing to `>=8.x.x`:
```
hapi@8.0.0 node_modules/hapi
```

with __hapi `5.0.0`__ installed, I got this error with the code on master:
```
% node index.js /opt/hapi-pg-usage
/opt/hapi-pg-usage/node_modules/hapi-pg/index.js:25
plugin.events.on('tail', function(request, err) {
^
TypeError: Cannot call method 'on' of undefined
```

with `hapi 8.0.0`, when I changed `plugin.events.on` to `plug.on`, the code no longer errored. this usage matches the sample usage in the ["Server events" section of the Hapi API docs](http://hapijs.com/api#server-events):

> The 'response' and 'tail' events include the request object