From a8c6eb9542e4baba3ce05da454fc52548214ba06 Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Sun, 6 Jul 2025 15:45:22 -0300 Subject: feat: kind of integrate activity pub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/pages/.well-known/webfinger.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/pages/.well-known/webfinger.ts (limited to 'src/pages/.well-known/webfinger.ts') 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" }, + }); +}; -- cgit v1.2.3