aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-02-07 01:07:34 -0800
committerFuwn <[email protected]>2024-02-07 01:07:34 -0800
commitb2cd85ceddb1d39924b858cb198a9784954fd4c5 (patch)
tree62c7afc68bbdf06da7221d0763db0c03bc28fcfa /src/routes/api
parentfix(match): skip specials and ovas in schedule (diff)
downloaddue.moe-b2cd85ceddb1d39924b858cb198a9784954fd4c5.tar.xz
due.moe-b2cd85ceddb1d39924b858cb198a9784954fd4c5.zip
feat(hololive): hololive schedule
Diffstat (limited to 'src/routes/api')
-rw-r--r--src/routes/api/hololive/+server.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/routes/api/hololive/+server.ts b/src/routes/api/hololive/+server.ts
new file mode 100644
index 00000000..331d776a
--- /dev/null
+++ b/src/routes/api/hololive/+server.ts
@@ -0,0 +1,10 @@
+import parseScheduleHtml from 'holo-schedule';
+import getScheduleHtml from 'holo-schedule/lib/getScheduleHtml';
+
+export const GET = async () =>
+ Response.json(parseScheduleHtml(await getScheduleHtml()), {
+ headers: {
+ 'Access-Control-Allow-Origin': 'https://due.moe',
+ 'Cache-Control': 'public, max-age=300, s-maxage=300'
+ }
+ });