hapi-lbstatus
Advanced tools
Comparing version 2.1.0 to 2.1.2
@@ -18,2 +18,8 @@ var service = require('./lib/provider'); | ||
plugin.expose('lbstatus', function(cb){ | ||
service.lbstatus(plugin.servers, options, function(result){ | ||
cb(result.code === 200); | ||
}); | ||
}); | ||
next(); | ||
@@ -24,2 +30,2 @@ }; | ||
pkg: require('./package.json') | ||
}; | ||
}; |
@@ -53,2 +53,2 @@ var fs = require("fs"), | ||
lbstatus: lbstatus | ||
}; | ||
}; |
{ | ||
"name": "hapi-lbstatus", | ||
"version": "2.1.0", | ||
"version": "2.1.2", | ||
"description": "lbstatus plugin for hapi", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,2 +38,8 @@ #Hapi lbstatus | ||
); | ||
// also exposes the lbstatus function | ||
server.plugins['hapi-lbstatus'].lbstatus(function(on){ | ||
// returns true if ON, false if OFF | ||
}); | ||
``` | ||
@@ -40,0 +46,0 @@ |
@@ -23,3 +23,4 @@ describe('lbstatus tests', function(){ | ||
r.push(route); | ||
} | ||
}, | ||
expose: function(name, fn){} | ||
}; | ||
@@ -32,2 +33,17 @@ | ||
it('should expose the lbstatus method', function(){ | ||
var p = require('../index.js'), | ||
r = [], | ||
plugin = { | ||
route: function(route) { | ||
r.push(route); | ||
}, | ||
expose: function(name, fn){ | ||
name.should.eql('lbstatus') | ||
} | ||
}; | ||
p.register(plugin, {}, function(){}); | ||
}); | ||
it('should read the file', function(done){ | ||
@@ -97,2 +113,2 @@ provider.lbstatus(servers, { | ||
}); | ||
}); | ||
}); |
10211
200
54