Skip to content

Commit

Permalink
clean up and setting default ports
Browse files Browse the repository at this point in the history
  • Loading branch information
maielo committed May 16, 2023
1 parent bc3f68f commit 7551eb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PORT=3002
CORS_ORIGIN=http://localhost:3000
PORT=
CORS_ORIGIN=
13 changes: 2 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ require("dotenv").config(
);

const app = express();
const port = process.env.PORT || 80; // default port to listen
const port =
process.env.PORT || process.env.NODE_ENV !== "development" ? 80 : 3002; // default port to listen

app.use(express.static("public"));

Expand All @@ -37,16 +38,6 @@ try {
credentials: true,
},
allowEIO3: true,
// handlePreflightRequest: (req, res) => {
// const headers = {
// "Access-Control-Allow-Headers": "Content-Type, Authorization",
// "Access-Control-Allow-Origin":
// (req.header && req.header.origin) || "https://excalidraw.com",
// "Access-Control-Allow-Credentials": true,
// };
// res.writeHead(200, headers);
// res.end();
// },
});

io.on("connection", (socket) => {
Expand Down

0 comments on commit 7551eb0

Please sign in to comment.