1
0
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:
Nick O'Leary 2013-12-19 11:05:03 +00:00
parent 751ac7b9ee
commit 02df584af6

View File

@ -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;