Document cli/server.js

This commit is contained in:
Samy Pessé
2016-04-27 18:02:49 +02:00
parent e781d6d2b1
commit 9a1a6f2625
+15 -2
View File
@@ -14,12 +14,20 @@ function Server() {
}
util.inherits(Server, events.EventEmitter);
// Return true if the server is running
/**
Return true if the server is running
@return {Boolean}
*/
Server.prototype.isRunning = function() {
return !!this.running;
};
// Stop the server
/**
Stop the server
@return {Promise}
*/
Server.prototype.stop = function() {
var that = this;
if (!this.isRunning()) return Promise();
@@ -40,6 +48,11 @@ Server.prototype.stop = function() {
return d.promise;
};
/**
Start the server
@return {Promise}
*/
Server.prototype.start = function(dir, port) {
var that = this, pre = Promise();
port = port || 8004;