fix(api): raise Fastify body size limit for AI menu photo uploads

Default 1 MiB limit rejected base64-encoded camera photos before the
request handler ever ran ("Request body is too large"), unrelated to
the OpenAI model. Also adds the public domains RLS policy needed for
custom-domain resolution on the public menu page (already applied
manually via SQL Editor, committing for history).
This commit is contained in:
AyrisAI
2026-08-20 05:13:03 +03:00
parent 93b2a77127
commit 1a3e46f16c
2 changed files with 19 additions and 1 deletions
+3 -1
View File
@@ -12,7 +12,9 @@ import { qrRoutes } from "./routes/qr.js";
import { restaurantsRoutes } from "./routes/restaurants.js";
import { subscriptionRoutes } from "./routes/subscription.js";
const app = Fastify({ logger: true });
// Default Fastify bodyLimit is 1 MiB — a base64-encoded menu photo from a
// phone camera routinely exceeds that, so AI import uploads need real headroom.
const app = Fastify({ logger: true, bodyLimit: 20 * 1024 * 1024 });
await app.register(cors);