summary refs log tree commit diff
path: root/src/Server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server.ts')
-rw-r--r--src/Server.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Server.ts b/src/Server.ts
new file mode 100644

index 00000000..3598c8e1 --- /dev/null +++ b/src/Server.ts
@@ -0,0 +1,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"); + } +}