mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
refactor(server) lConfig -> config, lProcessing -> options
This commit is contained in:
parent
bd1ecc950e
commit
5f6138d6bb
1 changed files with 14 additions and 14 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue