diff options
| author | Fuwn <[email protected]> | 2023-09-14 17:36:55 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-14 17:55:14 -0700 |
| commit | d113d662656c8cc662ff544dd50df828ccce66fa (patch) | |
| tree | 27666001291c5ffbbf49ccb15cb30b19e6bfa2c9 /src/routes/api/updates/novels | |
| parent | fix(updates): non-italic volume (diff) | |
| download | due.moe-d113d662656c8cc662ff544dd50df828ccce66fa.tar.xz due.moe-d113d662656c8cc662ff544dd50df828ccce66fa.zip | |
refactor(updates): move api routes
Diffstat (limited to 'src/routes/api/updates/novels')
| -rw-r--r-- | src/routes/api/updates/novels/+server.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/routes/api/updates/novels/+server.ts b/src/routes/api/updates/novels/+server.ts new file mode 100644 index 00000000..789fdf2e --- /dev/null +++ b/src/routes/api/updates/novels/+server.ts @@ -0,0 +1,13 @@ +import Parser from 'rss-parser'; + +export const GET = async ({ setHeaders }) => { + setHeaders({ + 'Cache-Control': 'public, max-age=600, s-maxage=600' + }); + + return Response.json( + await new Parser().parseString( + await (await fetch('https://api.syosetu.com/allnovel.Atom')).text() + ) + ); +}; |