import { NextResponse } from "next/server"; const TARGET_SERVER_BASE_URL = process.env.SERVER_BASE_URL || 'http://localhost:8001'; export async function GET() { try { // Forward the request to the backend API const response = await fetch(`${TARGET_SERVER_BASE_URL}/auth/status`, { method: 'GET', headers: { 'Content-Type': 'application/json', }, }); if (!response.ok) { return NextResponse.json( { error: `Backend server returned ${response.status}` }, { status: response.status } ); } const data = await response.json(); return NextResponse.json(data); } catch (error) { console.error('Error forwarding request to backend:', error); return NextResponse.json( { error: 'Internal Server Error' }, { status: 500 } ); } }