Bugfix: fix typescript issues

This commit is contained in:
Fabrice Baumann 2020-10-19 19:46:59 -04:00
parent 408cac825f
commit 3a67db8891
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "excalidraw-room", "name": "excalidraw-room",
"version": "1.0.0", "version": "1.0.1",
"description": "Excalidraw collaboration server", "description": "Excalidraw collaboration server",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -17,13 +17,13 @@ server.listen(port, () => {
}); });
const io = socketIO(server, { const io = socketIO(server, {
handlePreflightRequest: function (req, res) { handlePreflightRequest: function (server, req, res) {
var headers = { var headers = {
"Access-Control-Allow-Headers": "Content-Type, Authorization", "Access-Control-Allow-Headers": "Content-Type, Authorization",
"Access-Control-Allow-Origin": req.header ? req.header.origin : "*", "Access-Control-Allow-Origin": req.headers ? req.headers.origin : "*",
"Access-Control-Allow-Credentials": true, "Access-Control-Allow-Credentials": "true",
}; };
res.writeHead(200, headers); res.writeHead(200, 'cors', headers);
res.end(); res.end();
}, },
}); });