Skip to content

Commit

Permalink
Merge branch 'imdeveshshukla:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Rituraj67 authored Aug 24, 2024
2 parents 9dc9736 + 3cc7487 commit b0a48cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion backend/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,21 @@ dotenv.config({
})
const app = express()
const port = 3000
const dep = (origin, callback) => {
const allowedOrigins = [
'https://www.bequiet.live',
'https://www.bequiet.vercel.app'
];

if (allowedOrigins.includes(origin) || !origin) {
callback(null, true);
} else {
callback(new Error('Not allowed by CORS'));
}
};
const corsOptions = {
credentials: true,
origin: (process.env.NODE_ENV === 'development')?'http://localhost:5173':'https://www.bequiet.live',
origin: (process.env.NODE_ENV === 'development')?'http://localhost:5173':dep,
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allowedHeaders: [
"Origin",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/Notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const Notification = ({setIsNfnOpen}) => {
setIsLoading(false)
}
const addUserToRoom = async(title,fromUser)=>{
console.log(title+" "+fromUser);

setBigLoader(true)
try {
Expand Down

0 comments on commit b0a48cf

Please sign in to comment.