summary refs log tree commit diff
path: root/src/index.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-27 18:54:15 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-27 18:54:15 +0200
commit8f66556f5acf149fadd2fe0ac9e03f5e6225026e (patch)
tree6a4f9a72970f192e34e61ecc509dc71a65997707 /src/index.ts
parent:bug: fix CDN (diff)
downloadserver-8f66556f5acf149fadd2fe0ac9e03f5e6225026e.tar.xz
:construction: WIP rewrite
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts

index 64fca7e5..cdf88fd9 100644 --- a/src/index.ts +++ b/src/index.ts
@@ -1,6 +1,14 @@ import { CDNServer } from "./Server"; +import dotenv from "dotenv"; +dotenv.config(); -const server = new CDNServer({ db: "" }); +if (process.env.STORAGE_LOCATION) { + if (!process.env.STORAGE_LOCATION.startsWith("/")) { + process.env.STORAGE_LOCATION = __dirname + "/../" + process.env.STORAGE_LOCATION; + } +} else process.env.STORAGE_LOCATION = __dirname + "/../files/"; + +const server = new CDNServer(); server .start() .then(() => {