Commit 30fa53df authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Merge branch 'cors' into 'develop'

Add cross-origin resource sharing (CORS) headers to responses

See merge request !1
parents a0b3209d e14c42b7
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
}, },
"dependencies": { "dependencies": {
"body-parser": "^1.17.2", "body-parser": "^1.17.2",
"cors": "^2.8.4",
"express": "^4.15.3", "express": "^4.15.3",
"pic4carto": "^1.2.3", "pic4carto": "^1.2.3",
"use-strict": "^1.0.1", "use-strict": "^1.0.1",
......
...@@ -23,9 +23,13 @@ global.XMLHttpRequest.DONE = 4; ...@@ -23,9 +23,13 @@ global.XMLHttpRequest.DONE = 4;
const express = require('express'), const express = require('express'),
bodyParser = require('body-parser'), bodyParser = require('body-parser'),
cors = require('cors'),
app = express(), app = express(),
port = process.env.PORT || 28111; port = process.env.PORT || 28111;
app.use(cors());
app.options('*', cors());
app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json()); app.use(bodyParser.json());
app.use('/doc', express.static(__dirname+'/doc')); app.use('/doc', express.static(__dirname+'/doc'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment