mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Allow storage module to be set explicitly
Rather than just by name
This commit is contained in:
parent
751ac7b9ee
commit
02df584af6
@ -17,7 +17,18 @@
|
|||||||
|
|
||||||
var settings = require('../red').settings;
|
var settings = require('../red').settings;
|
||||||
|
|
||||||
var storageType = settings.storageModule || "localfilesystem";
|
var mod;
|
||||||
|
|
||||||
module.exports = require("./"+storageType);
|
if (settings.storageModule) {
|
||||||
|
if (typeof settings.storageModule === "string") {
|
||||||
|
// TODO: allow storage modules to be specified by absolute path
|
||||||
|
mod = require("./"+settings.storageModule);
|
||||||
|
} else {
|
||||||
|
mod = settings.storageModule;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mod = require("./localfilesystem");
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = mod;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user