1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/Storage.ts b/src/util/Storage.ts
new file mode 100644
index 00000000..ad00fbb7
--- /dev/null
+++ b/src/util/Storage.ts
@@ -0,0 +1,14 @@
+import { FileStorage } from "./FileStorage";
+
+export interface Storage {
+ set(hash: string, data: any, prefix?: string): Promise<void>;
+ get(hash: string, prefix?: string): Promise<any>;
+}
+
+var storage: Storage;
+
+if (process.env.STORAGE_PROVIDER === "file") {
+ storage = new FileStorage();
+}
+
+export { storage };
|