aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/subsplease/+server.ts
blob: 93e734c28802303e1f1d85e8141d4448fbe66d90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export const GET = async ({ url }) =>
  Response.json(
    await (
      await fetch(
        `https://subsplease.org/api/?f=schedule&tz=${
          url.searchParams.get('tz') || 'America/Los_Angeles'
        }`
      )
    ).json(),
    {
      headers: {
        'Cache-Control': 'max-age=86400, s-maxage=86400',
        'Access-Control-Allow-Origin': 'https://due.moe'
      }
    }
  );