Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
Hire-Guru
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vigneswaran Shanmugam
Hire-Guru
Commits
71d4a53e
Commit
71d4a53e
authored
Apr 07, 2026
by
AravindR-K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated
parent
1fdd41b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Backend/server.js
Backend/server.js
+12
-5
No files found.
Backend/server.js
View file @
71d4a53e
...
@@ -14,11 +14,18 @@ const app = express();
...
@@ -14,11 +14,18 @@ const app = express();
// Middleware
// Middleware
app
.
use
(
cors
({
app
.
use
(
cors
({
origin
:
[
origin
:
function
(
origin
,
callback
)
{
const
allowed
=
[
'
http://localhost:4200
'
,
'
http://localhost:4200
'
,
'
https://quiz-master-oxo7-4r2hvqr2w-aravind05rk.vercel.app
'
,
process
.
env
.
FRONTEND_URL
process
.
env
.
FRONTEND_URL
].
filter
(
Boolean
),
];
// Allow any origin that ends with 'vercel.app' or is directly allowed
if
(
!
origin
||
allowed
.
includes
(
origin
)
||
origin
.
endsWith
(
'
vercel.app
'
))
{
callback
(
null
,
true
);
}
else
{
callback
(
null
,
false
);
}
},
credentials
:
true
credentials
:
true
}));
}));
app
.
use
(
express
.
json
());
app
.
use
(
express
.
json
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment