summary refs log tree commit diff
path: root/src/util/Storage.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:16:17 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:16:17 +0200
commit87c7cf33d036c9ef1486d5d895f2b9a6b94bf045 (patch)
tree4bec620a49cd29b10b28f3596176f5f6a344cffd /src/util/Storage.ts
parent:sparkles: api (diff)
parentcatch for missing config error (diff)
downloadserver-87c7cf33d036c9ef1486d5d895f2b9a6b94bf045.tar.xz
Merge branch 'cdn'
Diffstat (limited to '')
-rw-r--r--src/util/Storage.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/Storage.ts b/src/util/Storage.ts
new file mode 100644

index 00000000..f8b09e71 --- /dev/null +++ b/src/util/Storage.ts
@@ -0,0 +1,15 @@ +import { FileStorage } from "./FileStorage"; + +export interface Storage { + set(path: string, data: Buffer): Promise<void>; + get(path: string): Promise<Buffer | null>; + delete(path: string): Promise<void>; +} + +var storage: Storage; + +if (process.env.STORAGE_PROVIDER === "file") { + storage = new FileStorage(); +} + +export { storage };