diff options
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 10 |
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(() => { |