refactor(server) start

This commit is contained in:
coderaiser 2014-02-24 11:02:54 -05:00
parent 6eaadb195f
commit 6e88653fb5

View file

@ -52,7 +52,7 @@
* @param pProcessing {index, appcache, rest}
*/
function start(options) {
var redirectServer, port, ip, isSSL, sslPort,
var redirectServer, port, ip, ssl, sslPort,
sockets, httpServer, serverLog,
HTTP = 'http://',
HTTPS = 'https://',
@ -74,7 +74,7 @@
config.ip ||
(main.WIN32 ? '127.0.0.1' : '0.0.0.0'),
isSSL = options.ssl,
ssl = options.ssl,
sslPort = config.sslPort,
sockets = function(pServer) {
@ -137,9 +137,9 @@
redirectServer.listen(port, ip);
Server = https.createServer(lSSL, respond);
Server = https.createServer(ssl, respond);
Server.on('error', function (error) {
Util.log(error, '\nCould not use https port: ' + lSSLPort);
Util.log(error, '\nCould not use https port: ' + sslPort);
redirectServer.close();
Util.log('* Redirection http -> https removed');
httpServer();