mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add httpAdminMiddleware for admin routes
This commit is contained in:
parent
189389f96a
commit
b0f9bf2c62
@ -59,6 +59,12 @@ function init(settings,_server,storage,runtimeAPI) {
|
||||
});
|
||||
adminApp.use(corsHandler);
|
||||
|
||||
if (settings.httpAdminMiddleware) {
|
||||
if (typeof settings.httpAdminMiddleware === "function") {
|
||||
adminApp.use(settings.httpAdminMiddleware)
|
||||
}
|
||||
}
|
||||
|
||||
auth.init(settings,storage);
|
||||
|
||||
var maxApiRequestSize = settings.apiMaxLength || '5mb';
|
||||
|
11
packages/node_modules/node-red/settings.js
vendored
11
packages/node_modules/node-red/settings.js
vendored
@ -182,6 +182,17 @@ module.exports = {
|
||||
// next();
|
||||
//},
|
||||
|
||||
|
||||
// The following property can be used to add a custom middleware function
|
||||
// in front of all admin http routes. For example, to set custom http
|
||||
// headers
|
||||
// httpAdminMiddleware: function(req,res,next) {
|
||||
// // Set the X-Frame-Options header to limit where the editor
|
||||
// // can be embedded
|
||||
// //res.set('X-Frame-Options', 'sameorigin');
|
||||
// next();
|
||||
// },
|
||||
|
||||
// The following property can be used to pass custom options to the Express.js
|
||||
// server used by Node-RED. For a full list of available options, refer
|
||||
// to http://expressjs.com/en/api.html#app.settings.table
|
||||
|
Loading…
Reference in New Issue
Block a user