diff options
author | Anthony Wang | 2021-05-06 21:18:44 -0500 |
---|---|---|
committer | Anthony Wang | 2021-05-06 21:18:44 -0500 |
commit | 34e1da1787aeb7219d6cc3d1a4d6df27c14ac34f (patch) | |
tree | 4eb7cabba1f355f8c0e6612e23dff1e39c9836d5 | |
parent | febafef42541ab963867cb87faef0035da27a65a (diff) |
Fix backend
-rw-r--r-- | back/src/Game.ts | 2 | ||||
-rw-r--r-- | back/src/server.ts | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/back/src/Game.ts b/back/src/Game.ts index 4643da6..293baa3 100644 --- a/back/src/Game.ts +++ b/back/src/Game.ts @@ -110,7 +110,7 @@ export default class Game { } while (this.lastPlayed > 0) { // Phase 2 await this.flip(); - if (this.phase === 3) { // Oops, flipped over a red card! + if (this.phase === 3 as number) { // Oops, flipped over a red card! await this.giveup(); // The player who called BS won and now the challenged player must give up a card! return; } diff --git a/back/src/server.ts b/back/src/server.ts index 49ab6ee..3fe879f 100644 --- a/back/src/server.ts +++ b/back/src/server.ts @@ -3,9 +3,9 @@ import http from 'http'; import https from 'https'; import {Server} from 'socket.io'; -export default new Server({cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}}); +//export default new Server({cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}}); -/*const base = process.env.SSL_KEY && process.env.SSL_CERT && process.env.SSL_CA ? https.createServer({ +const base = process.env.SSL_KEY && process.env.SSL_CERT && process.env.SSL_CA ? https.createServer({ "key": fs.readFileSync(process.env.SSL_KEY), "cert": fs.readFileSync(process.env.SSL_CERT), "ca": fs.readFileSync(process.env.SSL_CA) @@ -14,4 +14,4 @@ base.listen(+process.env.PORT!, () => { console.log(`Listening on port ${process.env.PORT}`); }); -export default new Server(base, {cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}});*/ +export default new Server(base, {cors: {origin: process.env.ORIGIN, methods: ['GET', 'POST']}}); |