import { checkRateLimit } from '$lib/rateLimit.js'; export const GET = async (event) => { const limit = await checkRateLimit(event); if (limit) return limit; try { return Response.json( await ( await fetch( `https://api.mangadex.org/manga/${event.url.searchParams.get( 'id' )}/feed?order[chapter]=desc&translatedLanguage[]=en&limit=1&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic` ) ).json(), { headers: { 'Cache-Control': 'max-age=300' } } ); } catch { return new Response('rate-limited'); } };