dev: allow separate origins for backend & frontend

This commit is contained in:
Grant 2024-02-15 19:43:18 -07:00
parent 774d56fbee
commit b1b4fdffb4
2 changed files with 7 additions and 1 deletions

View File

@ -22,6 +22,7 @@ class Network extends EventEmitter<INetworkEvents> {
import.meta.env.VITE_API_HOST, import.meta.env.VITE_API_HOST,
{ {
autoConnect: false, autoConnect: false,
withCredentials: true,
} }
); );
private online_count = 0; private online_count = 0;

View File

@ -36,6 +36,10 @@ const session = expressSession({
client: redisClient, client: redisClient,
prefix: "canvas_session:", prefix: "canvas_session:",
}), }),
cookie: {
sameSite: "none",
httpOnly: false,
},
}); });
const app = express(); const app = express();
const server = http.createServer(app); const server = http.createServer(app);
@ -55,7 +59,8 @@ const io = new Server<
} }
>(server, { >(server, {
cors: { cors: {
origin: "*", origin: "http://10.1.10.248:5173",
credentials: true,
}, },
}); });