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
440af7bd
Commit
440af7bd
authored
Nov 11, 2016
by
GanJc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access-control-allow-origin
parent
a22c8188
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
app.js
app.js
+13
-0
No files found.
app.js
View file @
440af7bd
...
...
@@ -15,6 +15,19 @@ var app = express();
app
.
set
(
'
views
'
,
path
.
join
(
__dirname
,
'
views
'
));
app
.
set
(
'
view engine
'
,
'
jade
'
);
//allow custom header and CORS
app
.
all
(
'
*
'
,
function
(
req
,
res
,
next
)
{
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-Methods
'
,
'
PUT, POST, GET, DELETE, OPTIONS
'
);
if
(
req
.
method
==
'
OPTIONS
'
)
{
res
.
send
(
200
);
}
else
{
next
();
}
});
// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app
.
use
(
logger
(
'
dev
'
));
...
...
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