Skip to content

Commit

Permalink
remove serverIsRunning.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Oct 15, 2014
1 parent c5fc8fd commit a11df56
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@ var Dredd = require('dredd');
var jshint = require('gulp-jshint');

var server;
var serverIsRunning;

function startServer(cb) {
if (serverIsRunning) {
if (server) {
setImmediate(cb);
} else {
server = require('./server').listen(8080, function() {
serverIsRunning = true;
cb();
});
server = require('./server').listen(8080, cb);
}
}

function stopServer(cb) {
if (serverIsRunning) {
if (server) {
server.close(function() {
serverIsRunning = false;
cb();
cb.apply(server, [].slice.call(arguments));
server = null;
});
} else {
setImmediate(cb);
Expand Down

0 comments on commit a11df56

Please sign in to comment.