feature(server) add combine

This commit is contained in:
coderaiser 2013-11-25 13:09:03 +00:00
parent d51fbece41
commit 597754364f

View file

@ -29,6 +29,7 @@
Util = main.util,
express = main.express,
expressApp = express.getApp(controller),
files = main.files,
Server, Rest, Route;
@ -168,6 +169,9 @@
if (!lRet && Route)
lRet = Util.exec(Route, lData);
if (!lRet)
lRet = combine(lPath, pRes);
if (!lRet) {
lName = lData.name;
@ -200,6 +204,26 @@
}
}
function combine(path, res) {
var names,
dir = DIR,
COMBINE = '/combine',
isCombine = Util.isContainStrAtBegin(path, COMBINE);
if (isCombine) {
path = Util.removeStrOneTime(path, COMBINE);
names = path.split(':');
console.log(names, DIR);
files.readPipe(names, dir, res, function(error) {
Util.log(error);
main.sendError(res);
});
}
return isCombine;
}
exports.start = start;
})();