mirror of https://github.com/node-red/node-red.git
pass options to express.static
This commit is contained in:
parent
889489e33e
commit
54b2215164
|
@ -427,6 +427,7 @@ httpsPromise.then(function(startupHttps) {
|
||||||
const sp = settings.httpStatic[si];
|
const sp = settings.httpStatic[si];
|
||||||
const filePath = sp.path;
|
const filePath = sp.path;
|
||||||
const thisRoot = sp.root || "/";
|
const thisRoot = sp.root || "/";
|
||||||
|
const options = sp.options;
|
||||||
if(appUseMem[filePath + "::" + thisRoot]) {
|
if(appUseMem[filePath + "::" + thisRoot]) {
|
||||||
continue;// this path and root already registered!
|
continue;// this path and root already registered!
|
||||||
}
|
}
|
||||||
|
@ -434,7 +435,7 @@ httpsPromise.then(function(startupHttps) {
|
||||||
if (settings.httpStaticAuth) {
|
if (settings.httpStaticAuth) {
|
||||||
app.use(thisRoot, basicAuthMiddleware(settings.httpStaticAuth.user, settings.httpStaticAuth.pass));
|
app.use(thisRoot, basicAuthMiddleware(settings.httpStaticAuth.user, settings.httpStaticAuth.pass));
|
||||||
}
|
}
|
||||||
app.use(thisRoot, express.static(filePath));
|
app.use(thisRoot, express.static(filePath, options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue