diff options
| author | Fuwn <[email protected]> | 2023-12-03 15:44:08 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-12-03 15:44:08 -0800 |
| commit | 7912f806314b88146a6a25931c8b6b008f406611 (patch) | |
| tree | 4d6ce54abee0bfc83f192ab0b57e55bbaf64778d /src/routes/api/birthdays | |
| parent | feat(birthdays): add second birthday source (diff) | |
| download | due.moe-7912f806314b88146a6a25931c8b6b008f406611.tar.xz due.moe-7912f806314b88146a6a25931c8b6b008f406611.zip | |
refactor(birthdays): move to modules
Diffstat (limited to 'src/routes/api/birthdays')
| -rw-r--r-- | src/routes/api/birthdays/acdb/+server.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/routes/api/birthdays/acdb/+server.ts b/src/routes/api/birthdays/acdb/+server.ts new file mode 100644 index 00000000..fe13ff7c --- /dev/null +++ b/src/routes/api/birthdays/acdb/+server.ts @@ -0,0 +1,19 @@ +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' + } + } + ) + ).json() + ); +}; |