mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-13 14:12:41 +01:00
🐛 use port from .env file
This commit is contained in:
parent
075d19607f
commit
801eee1cb3
@ -6,11 +6,14 @@ import { Server as WebSocketServer } from "ws";
|
|||||||
import { Connection } from "./events/Connection";
|
import { Connection } from "./events/Connection";
|
||||||
import Config from "./util/Config";
|
import Config from "./util/Config";
|
||||||
|
|
||||||
|
var port = Number(process.env.PORT);
|
||||||
|
if (isNaN(port)) port = 8080;
|
||||||
|
|
||||||
export class Server {
|
export class Server {
|
||||||
public ws: WebSocketServer;
|
public ws: WebSocketServer;
|
||||||
constructor() {
|
constructor() {
|
||||||
this.ws = new WebSocketServer({
|
this.ws = new WebSocketServer({
|
||||||
port: 8080,
|
port,
|
||||||
maxPayload: 4096,
|
maxPayload: 4096,
|
||||||
// perMessageDeflate: {
|
// perMessageDeflate: {
|
||||||
// zlibDeflateOptions: {
|
// zlibDeflateOptions: {
|
||||||
|
Loading…
Reference in New Issue
Block a user