feat: implement bff layer

This commit is contained in:
gosangam
2026-05-10 00:35:14 +05:30
parent 5951eb5e18
commit 32da38b24f
91 changed files with 2434 additions and 11784 deletions
+4 -4
View File
@@ -1,12 +1,12 @@
import { NextResponse } from "next/server";
import { prisma } from "@/lib/db";
import { getBookMeta } from "@/lib/api";
export async function GET(
_req: Request,
{ params }: { params: Promise<{ book: string }> }
{ params }: { params: Promise<{ book: string }> },
) {
const { book } = await params;
const meta = await prisma.bookMeta.findUnique({ where: { book } });
const meta = await getBookMeta(book);
if (!meta) return NextResponse.json({ error: "Not found" }, { status: 404 });
return NextResponse.json({ book: meta.book, ...meta.data as Record<string, unknown> });
return NextResponse.json(meta);
}