aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/birthdays/acdb/+server.ts
blob: ae9178a07365bae8afc310236558d8c8c4456cd6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export const GET = async ({ url }: { url: URL }) => {
	return Response.json(
		await (
			await fetch(
				`https://www.animecharactersdatabase.com/api_series_characters.php?month=${url.searchParams.get(
					'month'
				)}&day=${url.searchParams.get('day')}`,
				{
					headers: {
						Accept: 'application/json',
						'Content-Type': 'application/json',
						'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0',
						'Cache-Control': 'max-age=10, s-maxage=10'
					}
				}
			)
		).json(),
		{
			headers: {
				'Cache-Control': 'max-age=10800, s-maxage=10800',
				'Access-Control-Allow-Origin': 'https://due.moe'
			}
		}
	);
};