summary refs log tree commit diff
path: root/src/start.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:16:45 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-12 20:16:45 +0200
commit512375f6ed6f7fe895f0ebbb9494e7d2feb7a525 (patch)
treed2c68ddd310a7b50a46979671566e5ae6c1bf04c /src/start.ts
parentMerge branch 'cdn' (diff)
downloadserver-512375f6ed6f7fe895f0ebbb9494e7d2feb7a525.tar.xz
:sparkles: cdn
Diffstat (limited to 'src/start.ts')
-rw-r--r--src/start.ts27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/start.ts b/src/start.ts
deleted file mode 100644

index 57c9f704..00000000 --- a/src/start.ts +++ /dev/null
@@ -1,27 +0,0 @@ -import path from "path"; -import dotenv from "dotenv"; -import fse from "fs-extra"; -dotenv.config(); - -if (!process.env.STORAGE_PROVIDER) process.env.STORAGE_PROVIDER = "file"; -// TODO:nodejs path.join trailing slash windows compatible -if (process.env.STORAGE_PROVIDER === "file") { - if (process.env.STORAGE_LOCATION) { - if (!process.env.STORAGE_LOCATION.startsWith("/")) { - process.env.STORAGE_LOCATION = path.join(__dirname, "..", process.env.STORAGE_LOCATION, "/"); - } - } else { - process.env.STORAGE_LOCATION = path.join(__dirname, "..", "files", "/"); - } - fse.ensureDirSync(process.env.STORAGE_LOCATION); -} - -import { CDNServer } from "./Server"; - -const server = new CDNServer({ port: Number(process.env.PORT) || 3003 }); -server - .start() - .then(() => { - console.log("[Server] started on :" + server.options.port); - }) - .catch((e) => console.error("[Server] Error starting: ", e));