add support for all ports

This commit is contained in:
加里
2014-09-18 13:36:27 +08:00
parent e6da97a098
commit f5448677ac
7 changed files with 50 additions and 17 deletions

View File

@@ -41,6 +41,7 @@ module.exports = {
},
replaceServerResData: function(req,res,serverResData){
return serverResData;
},
pauseBeforeSendingResponse : function(req,res){

View File

@@ -22,3 +22,10 @@ module.exports.getUserHome = function(){
return process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
}
module.exports.simpleRender = function(str, object, regexp){
return String(str).replace(regexp || (/\{\{([^{}]+)\}\}/g), function(match, name){
if (match.charAt(0) == '\\') return match.slice(1);
return (object[name] != null) ? object[name] : '';
});
}