1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

🐛 use port from .env file

This commit is contained in:
Flam3rboy 2021-04-16 18:03:10 +02:00
parent 075d19607f
commit 801eee1cb3

View File

@ -6,11 +6,14 @@ import { Server as WebSocketServer } from "ws";
import { Connection } from "./events/Connection";
import Config from "./util/Config";
var port = Number(process.env.PORT);
if (isNaN(port)) port = 8080;
export class Server {
public ws: WebSocketServer;
constructor() {
this.ws = new WebSocketServer({
port: 8080,
port,
maxPayload: 4096,
// perMessageDeflate: {
// zlibDeflateOptions: {