From 37c70b25ac1c2ddbbf8155c1df52d6f27287616f Mon Sep 17 00:00:00 2001 From: lucaslah <47047328+Lucaslah@users.noreply.github.com> Date: Sun, 10 Oct 2021 14:23:05 +1300 Subject: [PATCH] Get port from env --- server/src/API/API.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/API/API.ts b/server/src/API/API.ts index 01d61fb..bcd29fc 100644 --- a/server/src/API/API.ts +++ b/server/src/API/API.ts @@ -30,7 +30,9 @@ export default class API { new InviteRouter(this.server, this.client); new MemberRouter(this.server, this.client); new OAuth2Router(this.server, this.client, this.oauth); + + const port = process.env.PORT as any || 8080 - createServer(this.server).listen(8080, "0.0.0.0", (): void => console.log(`${this.client.util.getTime()} | [ Matrix API ] Matrix website API member and OAuth2 routers are online and running.`)); + createServer(this.server).listen(port, "0.0.0.0", (): void => console.log(`${this.client.util.getTime()} | [ Matrix API ] Matrix website API member and OAuth2 routers are online and running.`)); }; -}; \ No newline at end of file +};