Newer
Older
percord / src / Server.ts
@Flam3rboy Flam3rboy on 28 May 2021 655 bytes :sparkles: attachments
import { Server, ServerOptions } from "lambert-server";
import { Config, db } from "@fosscord/server-util";
import path from "path";

export interface CDNServerOptions extends ServerOptions {}

export class CDNServer extends Server {
	public options: CDNServerOptions;

	constructor(options?: Partial<CDNServerOptions>) {
		super(options);
	}

	async start() {
		console.log("[Database] connecting ...");
		// @ts-ignore
		await (db as Promise<Connection>);
		await Config.init();
		console.log("[Database] connected");

		await this.registerRoutes(path.join(__dirname, "routes/"));
		return super.start();
	}

	async stop() {
		return super.stop();
	}
}