Skip to content

Commit

Permalink
update origin for cors
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahim-nazari committed Mar 6, 2024
1 parent 4a6c7e7 commit 009935b
Show file tree
Hide file tree
Showing 4 changed files with 354 additions and 11 deletions.
9 changes: 4 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ let gameStarted = false;
const channelQuestion = {};
//New imports
const httpServer = (0, http_1.createServer)(app);
const origin = process.env.NODE_ENV == "production"
? "https://convose-flashcard-activity.netlify.app"
: process.env.ORIGIN;
console.log("origin -----", origin);
const socketIO = new socket_io_1.Server(httpServer, {
cors: {
origin,
origin: [
"https://convose-flashcard-activity.netlify.app",
"http://localhost:3000",
],
},
});
//Add this before the app.get() block
Expand Down
Loading

0 comments on commit 009935b

Please sign in to comment.