Skip to content

Commit

Permalink
Merge pull request outmoded#73 from wpreul/master
Browse files Browse the repository at this point in the history
Updating to work with hapi 6
  • Loading branch information
Eran Hammer committed Jun 18, 2014
2 parents d1b4570 + 58553e0 commit d77ad57
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ the web page in real-time. To enable the debug console in a **hapi** application

```javascript
var Hapi = require('hapi');
var Tv = require('tv');

var server = new Hapi.Server();
var options = {
endpoint: '/debug/console',
queryKey: 'debug'
};

server.pack.require('./tv', options, function (err) {
server.pack.register({ plugin: Tv, options: options }, function (err) {

if (!err) {
server.start();
Expand Down
10 changes: 7 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Load modules

var Handlebars = require('handlebars');
var Hoek = require('hoek');
var Url = require('url');
var Ws = require('ws');
var Hoek = require('hoek');
var Handlebars = require('handlebars');


// Declare internals
Expand All @@ -26,7 +26,7 @@ exports.register = function (plugin, options, next) {

plugin.views({
engines: { html: { module: Handlebars } },
path: './templates'
path: __dirname + '/../templates'
});

plugin.route({
Expand Down Expand Up @@ -118,3 +118,7 @@ exports.register = function (plugin, options, next) {
});
};


exports.register.attributes = {
pkg: require('../package.json')
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tv",
"description": "Interactive debug console plugin for hapi",
"version": "1.2.0",
"version": "2.0.0",
"author": "Eran Hammer <[email protected]> (http://hueniverse.com)",
"contributors":[
"Wyatt Preul <[email protected]>",
Expand Down Expand Up @@ -29,7 +29,7 @@
"hapi": ">=2.x.x"
},
"devDependencies": {
"hapi": "5.x.x",
"hapi": "6.x.x",
"lab": "3.x.x"
},
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var Lab = require('lab');
var Hapi = require('hapi');
var Ws = require('ws');
var Tv = require('../');


// Declare internals
Expand Down Expand Up @@ -34,7 +35,7 @@ describe('Tv', function () {
}
});

server.pack.require('../', { port: 0 }, function (err) {
server.pack.register({ plugin: Tv, options: { port: 0 } }, function (err) {

expect(err).to.not.exist;

Expand Down Expand Up @@ -82,7 +83,7 @@ describe('Tv', function () {
}
});

server.pack.require('../', { port: 0, host: 'localhost' }, function (err) {
server.pack.register({ plugin: Tv, options: { port: 0, host: 'localhost' }}, function (err) {

expect(err).to.not.exist;

Expand Down Expand Up @@ -137,7 +138,7 @@ describe('Tv', function () {
}
});

server.pack.require('../', { host: '127.0.0.1', port: 0 }, function (err) {
server.pack.register({plugin: Tv, options: { host: '127.0.0.1', port: 0 } }, function (err) {

expect(err).to.not.exist;
done();
Expand Down

0 comments on commit d77ad57

Please sign in to comment.