Skip to content

Commit

Permalink
[bug] Serve static content for "storage-fs" only; Fix bug 67908
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed May 10, 2024
1 parent cb18e6a commit d8d2caa
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions DocService/sources/routes/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@ for (let i in cfgStaticContent) {
router.use(i, express.static(cfgStaticContent[i]['path'], cfgStaticContent[i]['options']));
}
}
initCacheRouter(cfgCacheStorage, [cfgCacheStorage.cacheFolderName]);

let persistentRouts = [cfgForgottenFiles, cfgErrorFiles];
persistentRouts.filter((rout) => {return rout && rout.length > 0;});
if (persistentRouts.length > 0) {
initCacheRouter(cfgPersistentStorage, [cfgForgottenFiles, cfgErrorFiles]);
if (cfgCacheStorage.name === "storage-fs") {
initCacheRouter(cfgCacheStorage, [cfgCacheStorage.cacheFolderName]);
}
if (cfgPersistentStorage.name === "storage-fs") {
let persistentRouts = [cfgForgottenFiles, cfgErrorFiles];
persistentRouts.filter((rout) => {return rout && rout.length > 0;});
if (persistentRouts.length > 0) {
initCacheRouter(cfgPersistentStorage, [cfgForgottenFiles, cfgErrorFiles]);
}
}

module.exports = router;

0 comments on commit d8d2caa

Please sign in to comment.