summary refs log tree commit diff
path: root/src/Server.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-06 17:08:08 +0100
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-02-06 17:08:08 +0100
commit471d1d6b28f8a6b62680408756e389e8a0b71be0 (patch)
treef95518dd3e846734feaeee613aa3f37f43dcde62 /src/Server.ts
parentuntrack DS_Store (diff)
downloadserver-471d1d6b28f8a6b62680408756e389e8a0b71be0.tar.xz
:sparkles: Base Server
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"); + } +}