30000
This commit is contained in:
@@ -13,7 +13,7 @@ const app = new Hono();
|
|||||||
app.use(
|
app.use(
|
||||||
"*",
|
"*",
|
||||||
cors({
|
cors({
|
||||||
origin: ["http://localhost:5173", "https://concord.kpuig.net"],
|
origin: ["http://localhost:5173", "https://concord.kpuig.net", "http://localhost:3000"],
|
||||||
allowHeaders: [
|
allowHeaders: [
|
||||||
"Content-Type",
|
"Content-Type",
|
||||||
"Authorization",
|
"Authorization",
|
||||||
@@ -45,7 +45,7 @@ app.get("/scalar", Scalar({ url: "/openapi" }));
|
|||||||
// initialize socket.io server
|
// initialize socket.io server
|
||||||
const io = new Server({
|
const io = new Server({
|
||||||
cors: {
|
cors: {
|
||||||
origin: ["http://localhost:5173", "https://concord.kpuig.net"],
|
origin: ["http://localhost:5173", "https://concord.kpuig.net", "http://localhost:3000"],
|
||||||
credentials: true,
|
credentials: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -70,7 +70,7 @@ export default {
|
|||||||
const origin = req.headers.get("Origin");
|
const origin = req.headers.get("Origin");
|
||||||
if (
|
if (
|
||||||
origin &&
|
origin &&
|
||||||
["http://localhost:5173", "https://concord.kpuig.net"].includes(origin)
|
["http://localhost:5173", "https://concord.kpuig.net", "http://localhost:3000"].includes(origin)
|
||||||
) {
|
) {
|
||||||
response.headers.set("Access-Control-Allow-Origin", origin);
|
response.headers.set("Access-Control-Allow-Origin", origin);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user