From 5f6138d6bbc8e122670268552b9b243fd49d8ff6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 10 Feb 2014 04:13:59 -0500 Subject: [PATCH] refactor(server) lConfig -> config, lProcessing -> options --- lib/server.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/server.js b/lib/server.js index 0adc24e1..ccbe65e8 100644 --- a/lib/server.js +++ b/lib/server.js @@ -51,28 +51,28 @@ * @param pConfig * @param pProcessing {index, appcache, rest} */ - function start(pProcessing) { - var lConfig = main.config; + function start(options) { + var config = main.config; - if (!pProcessing) - pProcessing = {}; + if (!options) + options = {}; - Rest = pProcessing.rest; - Route = pProcessing.route; + Rest = options.rest; + Route = options.route; - init(pProcessing.appcache); + init(options.appcache); var lPort = process.env.PORT || /* c9 */ process.env.app_port || /* nodester */ process.env.VCAP_APP_PORT || /* cloudfoundry */ - lConfig.port, + config.port, lIP = process.env.IP || /* c9 */ - lConfig.ip || + config.ip || (main.WIN32 ? '127.0.0.1' : '0.0.0.0'), - - lSSL = pProcessing.ssl, - lSSLPort = lConfig.sslPort, + + lSSL = options.ssl, + lSSLPort = config.sslPort, lHTTP = 'http://', lHTTPS = 'https://', @@ -80,7 +80,7 @@ var listen, msg, status = 'off'; - if (lConfig.socket && Socket) { + if (config.socket && Socket) { listen = Socket.listen(pServer); if (listen) { @@ -109,7 +109,7 @@ Util.log('* Server running at ' + pHTTP + lIP + ':' + pPort); }; /* server mode or testing mode */ - if (lConfig.server) { + if (config.server) { if (lSSL) { Util.log('* Redirection http -> https is setted up'); lServerLog(lHTTP, lPort);