Skip to content
Snippets Groups Projects
Commit e0719a2d authored by BARDET Brian's avatar BARDET Brian
Browse files

Problème avec les CORS

parent 8dccceb5
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,11 @@ wss.on('connection', function (ws) {
})
app.use(express.json());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
app.get('/', function (req, res) {
// res.send('OK')
res.sendFile('./index.html', { root: '.' })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment