feat: enable cors

This commit is contained in:
Max Koon
2025-10-20 15:21:54 -04:00
parent b0ebc98d42
commit 1b841c7d32

View File

@@ -10,7 +10,10 @@ const app = getHono();
app.use(
"/api/*",
cors({
origin: "*",
origin: (origin) =>
origin && /^https:\/\/([a-z0-9-]+\.)?koon\.us$/.test(origin)
? origin
: "",
allowMethods: ["POST", "GET", "OPTIONS"],
allowHeaders: ["Content-Type", "Authorization"],
credentials: true,