Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-arena-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
ygopro-arena-api
Commits
04cb8f8d
Commit
04cb8f8d
authored
Mar 06, 2017
by
ganjingcun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove CORS
parent
89002b2f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
app.js
app.js
+11
-11
No files found.
app.js
View file @
04cb8f8d
...
@@ -16,17 +16,17 @@ app.set('views', path.join(__dirname, 'views'));
...
@@ -16,17 +16,17 @@ app.set('views', path.join(__dirname, 'views'));
app
.
set
(
'
view engine
'
,
'
jade
'
);
app
.
set
(
'
view engine
'
,
'
jade
'
);
//allow custom header and CORS
//allow custom header and CORS
app
.
all
(
'
*
'
,
function
(
req
,
res
,
next
)
{
//
app.all('*', function (req, res, next) {
res
.
header
(
'
Access-Control-Allow-Origin
'
,
'
*
'
);
//
res.header('Access-Control-Allow-Origin', '*');
// res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
//
// res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
res
.
header
(
'
Access-Control-Allow-Methods
'
,
'
PUT, POST, GET, DELETE, OPTIONS
'
);
//
res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
if
(
req
.
method
==
'
OPTIONS
'
)
{
//
if (req.method == 'OPTIONS') {
res
.
send
(
200
);
//
res.send(200);
}
//
}
else
{
//
else {
next
();
//
next();
}
//
}
});
//
});
// uncomment after placing your favicon in /public
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
...
...
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