aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/mangadex/feed/+server.ts
blob: ab28ba2b570d5bf50f3a049a0b5c56e69ef5578d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
export const GET = async ({ url }) => {
	try {
		return Response.json(
			await (
				await fetch(
					`https://api.mangadex.org/manga/${url.searchParams.get(
						'id'
					)}/feed?order[chapter]=desc&translatedLanguage[]=en&limit=1&contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic`
				)
			).json()
		);
	} catch {
		return new Response('rate-limited');
	}
};