diff options
| author | Fuwn <[email protected]> | 2024-07-22 16:00:33 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-07-22 16:00:33 -0700 |
| commit | a7fe390be2b812e77395738eba395835dc45f007 (patch) | |
| tree | d821839a4bc0eb8f90e676a24595f49bc716c295 /src/routes/api/birthdays/secondary/+server.ts | |
| parent | fix(SequelSpy): use LinkedTooltip (diff) | |
| download | due.moe-a7fe390be2b812e77395738eba395835dc45f007.tar.xz due.moe-a7fe390be2b812e77395738eba395835dc45f007.zip | |
refactor(Birthday): rename modules
Diffstat (limited to 'src/routes/api/birthdays/secondary/+server.ts')
| -rw-r--r-- | src/routes/api/birthdays/secondary/+server.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/routes/api/birthdays/secondary/+server.ts b/src/routes/api/birthdays/secondary/+server.ts new file mode 100644 index 00000000..ae9178a0 --- /dev/null +++ b/src/routes/api/birthdays/secondary/+server.ts @@ -0,0 +1,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' + } + } + ); +}; |