mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
commit
9479b56549
7
packages/node_modules/node-red/red.js
vendored
7
packages/node_modules/node-red/red.js
vendored
@ -316,10 +316,10 @@ httpsPromise.then(function(startupHttps) {
|
|||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sp.subRoot = formatRoot(sp.root);
|
sp.subRoot = formatRoot(sp.root || "/");
|
||||||
sp.root = formatRoot(path.posix.join(settings.httpStaticRoot,sp.subRoot));
|
sp.root = formatRoot(path.posix.join(settings.httpStaticRoot,sp.subRoot));
|
||||||
}
|
}
|
||||||
settings.httpStatic = sanitised.length ? sanitised : false;
|
settings.httpStatic = sanitised.length ? sanitised : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we got a port from command line, use it (even if 0)
|
// if we got a port from command line, use it (even if 0)
|
||||||
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
packages/node_modules/node-red/settings.js
vendored
9
packages/node_modules/node-red/settings.js
vendored
@ -223,10 +223,15 @@ module.exports = {
|
|||||||
* to move httpAdminRoot
|
* to move httpAdminRoot
|
||||||
*/
|
*/
|
||||||
//httpStatic: '/home/nol/node-red-static/', //single static source
|
//httpStatic: '/home/nol/node-red-static/', //single static source
|
||||||
/* OR multiple static sources can be created using an array of objects... */
|
/**
|
||||||
|
* OR multiple static sources can be created using an array of objects...
|
||||||
|
* Each object can also contain an options object for further configuration.
|
||||||
|
* See https://expressjs.com/en/api.html#express.static for available options.
|
||||||
|
*/
|
||||||
//httpStatic: [
|
//httpStatic: [
|
||||||
// {path: '/home/nol/pics/', root: "/img/"},
|
// {path: '/home/nol/pics/', root: "/img/"},
|
||||||
// {path: '/home/nol/reports/', root: "/doc/"},
|
// {path: '/home/nol/reports/', root: "/doc/"},
|
||||||
|
// {path: '/home/nol/videos/', root: "/vid/", options: {maxAge: '1d'}}
|
||||||
//],
|
//],
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -431,7 +436,7 @@ module.exports = {
|
|||||||
enabled: true
|
enabled: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user