hapi-lbstatus
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -11,3 +11,3 @@ var service = require('./lib/provider'); | ||
service.lbstatus(plugin.servers, options, function(result){ | ||
reply(result).code(200); | ||
reply(result.body).code(result.code); | ||
}); | ||
@@ -14,0 +14,0 @@ } |
@@ -46,4 +46,4 @@ var fs = require("fs"), | ||
}, function(){ | ||
var failures = results.filter(function(i){ return i === false; }); | ||
callback(failures.length === 0 ? on : off); | ||
var failed = results.filter(function(i){ return i === false; }).length > 0; | ||
callback({ body: failed ? off : on, code: failed ? 503 : 200}); | ||
}); | ||
@@ -50,0 +50,0 @@ }; |
{ | ||
"name": "hapi-lbstatus", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "lbstatus plugin for hapi", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -40,2 +40,6 @@ #Hapi lbstatus | ||
Response Codes: | ||
- ON: 200 | ||
- OFF: 503 | ||
Notes: | ||
@@ -42,0 +46,0 @@ |
@@ -38,3 +38,4 @@ describe('lbstatus tests', function(){ | ||
}, function(result){ | ||
result.should.eql('OTWEB_ON'); | ||
result.body.should.eql('OTWEB_ON'); | ||
result.code.should.eql(200); | ||
done(); | ||
@@ -51,3 +52,4 @@ }); | ||
}, function(result){ | ||
result.should.eql('OTWEB_OFF'); | ||
result.body.should.eql('OTWEB_OFF'); | ||
result.code.should.eql(503); | ||
done(); | ||
@@ -64,3 +66,4 @@ }); | ||
}, function(result){ | ||
result.should.eql('OTWEB_OFF'); | ||
result.body.should.eql('OTWEB_OFF'); | ||
result.code.should.eql(503); | ||
done(); | ||
@@ -77,3 +80,4 @@ }); | ||
}, function(result){ | ||
result.should.eql('blarg'); | ||
result.body.should.eql('blarg'); | ||
result.code.should.eql(200); | ||
done(); | ||
@@ -90,3 +94,4 @@ }); | ||
}, function(result){ | ||
result.should.eql('OTWEB_OFF'); | ||
result.body.should.eql('OTWEB_OFF'); | ||
result.code.should.eql(503); | ||
done(); | ||
@@ -93,0 +98,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9462
178
48