diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-07-10 05:54:23 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2025-07-10 05:54:23 +0000 |
| commit | aae3ef17eccf0752edb5ce5638a58444ccb6ce3a (patch) | |
| tree | ea8211167bcf673c410a6805e018cb746ab0140e /packages/api/index.ts | |
| parent | f7f577af54dd704656f978bf392b203f216c6a98 (diff) | |
| download | karakeep-aae3ef17eccf0752edb5ce5638a58444ccb6ce3a.tar.zst | |
fix(api): Fix handling for CORS after the trpc move to hono. Fixes #1709
Diffstat (limited to 'packages/api/index.ts')
| -rw-r--r-- | packages/api/index.ts | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
