Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Alfakhori
M4labplatform
Commits
3bbab12b
Commit
3bbab12b
authored
Oct 16, 2020
by
Patrick
Browse files
test cors
parent
d9a37f1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.js
View file @
3bbab12b
...
...
@@ -9,6 +9,12 @@ const request = require('ajax-request');
const
app
=
express
();
app
.
all
(
'
*
'
,
function
(
req
,
res
,
next
)
{
res
.
header
(
'
Access-Control-Allow-Origin
'
,
'
*
'
);
res
.
header
(
'
Access-Control-Allow-Methods
'
,
'
PUT, GET, POST, DELETE, OPTIONS
'
);
res
.
header
(
'
Access-Control-Allow-Headers
'
,
'
Content-Type
'
);
next
();
});
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
app
.
use
(
bodyParser
.
json
())
// Certificate
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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