From f0d59bb37d131f361adc9beb5347f3ad6d2ed644 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 31 May 2021 20:41:44 +0200 Subject: [PATCH] :sparkles: start.ts file --- package-lock.json | Bin 109852 -> 109852 bytes package.json | 4 ++-- src/index.ts | 18 +----------------- src/start.ts | 17 +++++++++++++++++ 4 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 src/start.ts diff --git a/package-lock.json b/package-lock.json index 0c0b45d24984ec907b9f11b3ea4994557ecb1466..5c2ff2f217d6514a7e23689dac2e92169ef5316b 100644 GIT binary patch delta 247 zcmbPpi*3#=whcl|j3(39M>A?|wq@GZJbjV^qyF@sC`Og(BFh;SLd{cLB21!6yiKDl zl3c>_y*>TREA`DYv`x~Dlfq3yLqn1Re8V!m-2F3sGhB@=lPr8IO9GrKL!ydZUA2Q! z^@F1l-E&=C%bhY(T`fJ_4Fa=LOe-fh-ci_myRGRmU2L14xP(z=^6j=&+h0dB8U_LY D1=&-* delta 244 zcmbPpi*3#=whcl|lMk_KZ?nS8r#)%MrXjD~>#-!oIu diff --git a/package.json b/package.json index fe8e0bf1..580f837f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc -b .", - "start": "npm run build && node dist/" + "start": "npm run build && node dist/start.js" }, "repository": { "type": "git", @@ -30,7 +30,7 @@ "file-type": "^16.5.0", "image-size": "^1.0.0", "lambert-db": "^1.2.3", - "lambert-server": "^1.2.1", + "lambert-server": "^1.2.4", "missing-native-js-functions": "^1.0.8", "multer": "^1.4.2", "node-fetch": "^2.6.1", 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));