mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
feature(server) add combine
This commit is contained in:
parent
d51fbece41
commit
597754364f
1 changed files with 24 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue