From aae3ef17eccf0752edb5ce5638a58444ccb6ce3a Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Thu, 10 Jul 2025 05:54:23 +0000 Subject: fix(api): Fix handling for CORS after the trpc move to hono. Fixes #1709 --- packages/api/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '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 -- cgit v1.2.3-70-g09d2