+server.js 672 Bytes
const API_BASE = 'http://136.112.29.74/api/finfun/clasificador';

export async function GET() {
  try {
    const response = await fetch(API_BASE);
    if (!response.ok) {
      return new Response(JSON.stringify({ error: `API error: ${response.status}` }), {
        status: response.status, headers: { 'Content-Type': 'application/json' }
      });
    }
    const data = await response.json();
    return new Response(JSON.stringify(data), {
      headers: { 'Content-Type': 'application/json' }
    });
  } catch {
    return new Response(JSON.stringify({ error: 'Failed to fetch' }), {
      status: 500, headers: { 'Content-Type': 'application/json' }
    });
  }
}