summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-31 20:41:44 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-31 20:41:44 +0200
commitf0d59bb37d131f361adc9beb5347f3ad6d2ed644 (patch)
tree585f3b2a46c261bc4065318d90d65972a367cc6d /src
parentnpm i @fosscord/server-util@1.3.14 (diff)
downloadserver-f0d59bb37d131f361adc9beb5347f3ad6d2ed644.tar.xz
:sparkles: start.ts file
Diffstat (limited to 'src')
-rw-r--r--src/index.ts18
-rw-r--r--src/start.ts17
2 files changed, 18 insertions, 17 deletions
diff --git a/src/index.ts b/src/index.ts

index 72175f46..7513bd2f 100644 --- a/src/index.ts +++ b/src/index.ts
@@ -1,17 +1 @@ -import { CDNServer } from "./Server"; -import dotenv from "dotenv"; -dotenv.config(); - -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({ 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)); +export * from "./Server"; diff --git a/src/start.ts b/src/start.ts new file mode 100644
index 00000000..72175f46 --- /dev/null +++ b/src/start.ts
@@ -0,0 +1,17 @@ +import { CDNServer } from "./Server"; +import dotenv from "dotenv"; +dotenv.config(); + +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({ 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));