rcgit

/ karakeep

Commit aae3ef17

SHA aae3ef17eccf0752edb5ce5638a58444ccb6ce3a
Author Mohamed Bassem <me at mbassem dot com>
Author Date 2025-07-10 05:54 +0000
Committer Mohamed Bassem <me at mbassem dot com>
Commit Date 2025-07-10 05:54 +0000
Parent(s) f7f577af54dd (diff)
Tree ea8211167bcf

patch snapshot

fix(api): Fix handling for CORS after the trpc move to hono. Fixes #1709
File + - Graph
M packages/api/index.ts +6 -0
1 file(s) changed, 6 insertions(+), 0 deletions(-)

packages/api/index.ts

diff --git a/packages/api/index.ts b/packages/api/index.ts
index 4103e033..a2882381 100644
--- a/packages/api/index.ts
+++ b/packages/api/index.ts
@@ -1,5 +1,6 @@
 import { Hono } from "hono";
 import { logger } from "hono/logger";
+import { cors } from "hono/cors";
 import { poweredBy } from "hono/powered-by";
 
 import { Context } from "@karakeep/trpc";
@@ -38,6 +39,11 @@ const app = new Hono<{
 }>()
   .use(logger())
   .use(poweredBy())
+  .use(cors({
+    origin: "*",
+    allowHeaders: ["Authorization", "Content-Type"],
+    credentials: true,
+  }))
   .use("*", registerMetrics)
   .use(async (c, next) => {
     // Ensure that the ctx is set