aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/novel-updates/+server.ts
blob: 789fdf2e0b6fce8760716bda9e5ef1acdff11d41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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()
		)
	);
};