diff --git a/app/page.tsx b/app/page.tsx index aa93745..5b6ca3a 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -168,11 +168,10 @@ export default function Home() { })) ) - // Make a direct request to the backend API instead of using the crawlPages function - const backendUrl = process.env.NEXT_PUBLIC_BACKEND_URL || process.env.BACKEND_URL || 'http://localhost:24125' - console.log('Making direct request to backend:', `${backendUrl}/api/crawl`) + // Use the Next.js API route instead of direct backend request + console.log('Making request to Next.js API route: /api/crawl') - const response = await fetch(`${backendUrl}/api/crawl`, { + const response = await fetch(`/api/crawl`, { method: 'POST', headers: { 'Content-Type': 'application/json',