Initial commit - WhyRating Engine (Google Reviews Scraper)
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000';
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8001';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
const { searchParams } = new URL(request.url);
|
||||
const limit = searchParams.get('limit') || '100';
|
||||
const status = searchParams.get('status');
|
||||
|
||||
const response = await fetch(`${API_BASE_URL}/jobs?limit=${limit}`);
|
||||
let url = `${API_BASE_URL}/jobs?limit=${limit}`;
|
||||
if (status) {
|
||||
url += `&status=${status}`;
|
||||
}
|
||||
|
||||
const response = await fetch(url);
|
||||
|
||||
if (!response.ok) {
|
||||
return NextResponse.json(
|
||||
|
||||
Reference in New Issue
Block a user