diff --git a/red/storage/index.js b/red/storage/index.js index 1dfc320db..87cf4dfd0 100644 --- a/red/storage/index.js +++ b/red/storage/index.js @@ -17,7 +17,18 @@ 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;