view:function(cfg){ if(cfg.tpl){ view.init(cfg.tpl); } if(cfg.debug){ view.debug(cfg.debug); } if(cfg.constant){ view.constant(cfg.constant); } return this; },
/** cfg = { listen:80 , [needed] } **/ function Server(cfg){ this.cfg = this.prepareCfg(cfg); this.root = cfg.root; this.routermap = {}; this.filtermap = function(){}; this.serv = null; if(cfg.tpl){ view.init(cfg.tpl); }else{ view.render = function(){return 'view is not inited ! please re-config the server .';}; } }