jayli-server
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -330,6 +330,11 @@ /** | ||
var awpp_include = '<!--HTTP:([^,]+),(utf-8|utf8|gbk|gb2312):HTTP-->'; | ||
cont = cont.replace(new RegExp(awpp_include),function(){ | ||
var awpp_include_nake = '<!--HTTP:([^,]+):HTTP-->'; | ||
cont = cont.replace(new RegExp(awpp_include,'ig'),function(){ | ||
var args = arguments; | ||
return "<!--#include " + 'virtual="' + args[1] + '" -->'; | ||
}); | ||
cont = cont.replace(new RegExp(awpp_include_nake,'ig'),function(){ | ||
var args = arguments; | ||
return "<!--#include " + 'virtual="' + args[1] + '" -->'; | ||
}); | ||
return cont; | ||
@@ -336,0 +341,0 @@ } |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "A node.js module for delivering static files,width ssi,mock and php", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
@@ -41,4 +41,5 @@ # jayli | ||
}) | ||
.after(function(statCode) { | ||
.after(function(statCode, filepath, fileBuffer, encoding) { | ||
log(statCode, req.url, ip); | ||
return fileBuffer; | ||
}) | ||
@@ -185,6 +186,15 @@ .error(function(statCode, msg) { | ||
#### after(callback(statCode)) | ||
#### after(callback(statCode, filepath, fileBuffer, encoding)) | ||
Fires after a file has been successfully delivered from the `webroot`. `statCode` contains the numeric HTTP status code that was sent to the client. You must close the connection yourself if the error callback fires! | ||
> after 回调现已支持将文件 Buffer 对外暴露出来,从而进行按需处理(如替换页面引入的静态资源、修改 DOM 等)之后再响应回客户端。 | ||
> | ||
> 参数: | ||
> - statCode: 状态码; | ||
> - filepath: 文件路径; | ||
> - fileBuffer: 文件Buffer; | ||
> - encoding: 文件编码 | ||
#### error(callback(statCode, msg)) | ||
@@ -191,0 +201,0 @@ |
240159
2752
217