summary refs log tree commit diff
path: root/src/Server.ts
blob: 3598c8e15f699e6cbbb57ce5170e114ef7a01448 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { db } from "discord-server-util";
import { Server as WebSocketServer } from "ws";
import { Connection } from "./events/Connection";

export class Server {
	public ws: WebSocketServer;
	constructor() {
		this.ws = new WebSocketServer({ port: 8080, maxPayload: 4096 });
		this.ws.on("connection", Connection);
	}

	async listen(): Promise<void> {
		await db.init();
		console.log("listening");
	}
}