Merge pull request #3542 from Steve-Mcl/httpstatic-improvements

Add support for multiple static paths with optional static root
This commit is contained in:
Nick O'Leary
2022-04-25 20:21:54 +01:00
committed by GitHub
3 changed files with 65 additions and 7 deletions

View File

@@ -207,8 +207,12 @@ function start() {
if (settings.readOnly){
log.info(log._("settings.readonly-mode"))
}
if (settings.httpStatic) {
log.info(log._("runtime.paths.httpStatic",{path:path.resolve(settings.httpStatic)}));
if (settings.httpStatic && settings.httpStatic.length) {
for (let si = 0; si < settings.httpStatic.length; si++) {
let p = path.resolve(settings.httpStatic[si].path);
let r = settings.httpStatic[si].root || "/";
log.info(log._("runtime.paths.httpStatic",{path:`${p} > ${r}`}));
}
}
return redNodes.loadContextsPlugin().then(function () {
redNodes.loadFlows().then(redNodes.startFlows).catch(function(err) {});