summary refs log tree commit diff
path: root/src/index.ts
blob: cdf88fd9cdfc5c9fbcec233256fa3d43237b3a11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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();
server
	.start()
	.then(() => {
		console.log("[Server] started on :" + server.options.port);
	})
	.catch((e) => console.error("[Server] Error starting: ", e));