✨ start.ts file

This commit is contained in:
Flam3rboy
2021-05-31 20:41:44 +02:00
parent 3f4df736d0
commit f0d59bb37d
4 changed files with 27 additions and 26 deletions
+1 -17
View File
@@ -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";
+17
View File
@@ -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));