mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(route) readFiles on every route
This commit is contained in:
parent
56cacc5e5f
commit
2cede5bf21
1 changed files with 8 additions and 4 deletions
|
|
@ -35,9 +35,11 @@
|
|||
|
||||
FS = CloudFunc.FS;
|
||||
|
||||
module.exports = route;
|
||||
|
||||
readFiles();
|
||||
module.exports = function(req, res, next) {
|
||||
readFiles(function() {
|
||||
route(req, res, next);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* additional processing of index file
|
||||
|
|
@ -74,7 +76,7 @@
|
|||
return data;
|
||||
}
|
||||
|
||||
function readFiles() {
|
||||
function readFiles(callback) {
|
||||
var filesList, paths = {};
|
||||
|
||||
filesList = TMPL_PATH.map(function(name) {
|
||||
|
|
@ -106,6 +108,8 @@
|
|||
msg = CloudFunc.formatMsg('read', names, status);
|
||||
Util.log(msg);
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue