refactor(server) lConfig -> config, lProcessing -> options

This commit is contained in:
coderaiser 2014-02-10 04:13:59 -05:00
parent bd1ecc950e
commit 5f6138d6bb

View file

@ -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);