diff options
Diffstat (limited to 'src/pages/.well-known/webfinger.ts')
-rw-r--r-- | src/pages/.well-known/webfinger.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/pages/.well-known/webfinger.ts b/src/pages/.well-known/webfinger.ts new file mode 100644 index 0000000..5f5ca8e --- /dev/null +++ b/src/pages/.well-known/webfinger.ts @@ -0,0 +1,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" }, + }); +}; |