diff options
| author | Fuwn <[email protected]> | 2023-09-14 18:32:20 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-14 18:32:20 -0700 |
| commit | a0a8d644a9cb747c119e1b6e68dedbb7471d9fe0 (patch) | |
| tree | 0d526dc43095f0269c4a7b16d3bf2956e2159d9a /src/routes/api | |
| parent | refactor(updates): move api routes (diff) | |
| download | due.moe-a0a8d644a9cb747c119e1b6e68dedbb7471d9fe0.tar.xz due.moe-a0a8d644a9cb747c119e1b6e68dedbb7471d9fe0.zip | |
feat(updates): english novel updates
Diffstat (limited to 'src/routes/api')
| -rw-r--r-- | src/routes/api/updates/all-novels/+server.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/routes/api/updates/all-novels/+server.ts b/src/routes/api/updates/all-novels/+server.ts new file mode 100644 index 00000000..f27bb960 --- /dev/null +++ b/src/routes/api/updates/all-novels/+server.ts @@ -0,0 +1,19 @@ +export const GET = async ({ setHeaders }) => { + setHeaders({ + 'Cache-Control': 'public, max-age=600, s-maxage=600' + }); + + return Response.json( + await ( + await fetch('https://www.wlnupdates.com/api', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ + mode: 'get-releases' + }) + }) + ).json() + ); +}; |