use nodejs http lib directly to check service status

This commit is contained in:
Iuri Matias 2017-02-18 23:17:43 -05:00
parent 10b0f862a5
commit 38c98f16fa
2 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,7 @@
var path = require('path'); var path = require('path');
var grunt = require('grunt'); var grunt = require('grunt');
var merge = require('merge'); var merge = require('merge');
var request = require('request'); var http = require('http');
var shelljs = require('shelljs'); var shelljs = require('shelljs');
function joinPath() { function joinPath() {
@ -22,8 +22,10 @@ function recursiveMerge(target, source) {
} }
function checkIsAvailable(url, callback) { function checkIsAvailable(url, callback) {
request(url, function(error, response, body) { http.get(url, function(res) {
callback(!error); callback(true);
}).on('error', function(res) {
callback(false);
}); });
} }

View File

@ -27,7 +27,6 @@
"fs-extra": "^2.0.0", "fs-extra": "^2.0.0",
"grunt": "^1.0.1", "grunt": "^1.0.1",
"merge": "^1.2.0", "merge": "^1.2.0",
"request": "^2.75.0",
"serve-static": "^1.11.1", "serve-static": "^1.11.1",
"shelljs": "^0.5.0", "shelljs": "^0.5.0",
"solc": "0.4.8", "solc": "0.4.8",