aboutsummaryrefslogtreecommitdiff
path: root/src/server/index.js
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2023-07-15 02:46:14 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2023-07-15 02:46:14 +0530
commit72e89afac0f11d59e4399f245e6dcc728bec38d9 (patch)
tree481d5b9fb330f1a3528aa772dacf4a20e035fe65 /src/server/index.js
parent6036a220e251a9963e62508ae7dfeb68b2f289a2 (diff)
cleaned up code, added timeout, etc
Diffstat (limited to 'src/server/index.js')
-rw-r--r--src/server/index.js9
1 files changed, 2 insertions, 7 deletions
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}`);
});