From 72e89afac0f11d59e4399f245e6dcc728bec38d9 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sat, 15 Jul 2023 02:46:14 +0530 Subject: cleaned up code, added timeout, etc --- src/server/index.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/server') diff --git a/src/server/index.js b/src/server/index.js index 004c989..3c9d683 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -1,15 +1,13 @@ const express = require('express'); const app = express(); const http = require('http').Server(app); -const path = require('path'); const io = require("socket.io")(http, { cors: { origin: [ "http://localhost:5000", "http://localhost:3000", - "https://mikunonaka-tic-tac-toe.herokuapp.com", - "http://mikunonaka-tic-tac-toe.herokuapp.com" + "https://ttt.vidhukant.com", ], "Access-Control-Allow-Origin": "*", methods: ["GET", "POST"] @@ -98,11 +96,8 @@ io.on('connection', (socket) => { }); }); -// serve static front end -app.use(express.static(path.join(__dirname, '../../build'))); - // Start the server const PORT = process.env.PORT || 5000; http.listen(PORT, () => { - console.log(`App listening on port ${PORT}`); + console.log(`App listening on port ${PORT}`); }); -- cgit v1.2.3