From 471d1d6b28f8a6b62680408756e389e8a0b71be0 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 6 Feb 2021 17:08:08 +0100 Subject: :sparkles: Base Server --- src/Server.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/Server.ts (limited to 'src/Server.ts') 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 { + await db.init(); + console.log("listening"); + } +} -- cgit 1.5.1