feat: enable cors
This commit is contained in:
@@ -10,7 +10,10 @@ const app = getHono();
|
|||||||
app.use(
|
app.use(
|
||||||
"/api/*",
|
"/api/*",
|
||||||
cors({
|
cors({
|
||||||
origin: "*",
|
origin: (origin) =>
|
||||||
|
origin && /^https:\/\/([a-z0-9-]+\.)?koon\.us$/.test(origin)
|
||||||
|
? origin
|
||||||
|
: "",
|
||||||
allowMethods: ["POST", "GET", "OPTIONS"],
|
allowMethods: ["POST", "GET", "OPTIONS"],
|
||||||
allowHeaders: ["Content-Type", "Authorization"],
|
allowHeaders: ["Content-Type", "Authorization"],
|
||||||
credentials: true,
|
credentials: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user