Skip to content

Commit 386ae59

Browse files
committed
Fix API route access from admin subdomain and update Gemini model
1 parent c2b8582 commit 386ae59

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

web/src/app/api/agent/generate-leela/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function POST(req: NextRequest) {
2424

2525
// Prepare the Chief Editor Prompt with Quality Assessment
2626
const model = genAI.getGenerativeModel({
27-
model: "gemini-3-pro-preview",
27+
model: "gemini-2.0-flash-exp",
2828
generationConfig: { responseMimeType: "application/json" }
2929
});
3030

web/src/middleware.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export default clerkMiddleware(async (auth, req) => {
1414
// 1. Admin Subdomain Logic
1515
// Check for "admin." prefix (works for admin.saileelarahasya.com and admin.localhost)
1616
if (hostname.startsWith("admin.")) {
17+
// Allow API routes to pass through without rewriting
18+
if (url.pathname.startsWith('/api')) {
19+
return NextResponse.next();
20+
}
1721
// If already on /admin path, don't double-prefix
1822
if (url.pathname.startsWith('/admin')) {
1923
return NextResponse.next();

0 commit comments

Comments
 (0)