summaryrefslogtreecommitdiff
path: root/src/pages/.well-known/webfinger.ts
blob: 5f5ca8ecdeca4797d40f8650d38e9129645fdbee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import type { APIRoute } from "astro";
import { env } from "../../lib/environment.ts";

const { PUBLIC_SITE_URL } = env;
const site = new URL(PUBLIC_SITE_URL);

const webfinger = {
  "subject": "acct:cravodeabril@cravodeabril.pt",
  "links": [
    {
      "rel": "self",
      "type": "application/activity+json",
      "href": new URL("actor.json", site),
    },
  ],
};

export const GET: APIRoute = (): Response => {
  return new Response(JSON.stringify(webfinger), {
    headers: { "Content-Type": "application/json" },
  });
};