feat(netlify): add an edge function for WebFinger
This commit is contained in:
parent
e8f357a125
commit
1b8466c0b4
|
@ -8,3 +8,8 @@
|
|||
[[edge_functions]]
|
||||
path = "/*"
|
||||
function = "root"
|
||||
|
||||
|
||||
[[edge_functions]]
|
||||
function = "webfinger"
|
||||
path = "/.well-known/webfinger"
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
import type { Context } from "https://edge.netlify.com";
|
||||
|
||||
export default async (request: Request, context: Context) => {
|
||||
context.log(request.url);
|
||||
return context.json({
|
||||
subject: "acct:msfjarvis@androiddev.social",
|
||||
aliases: [
|
||||
"https://androiddev.social/@msfjarvis",
|
||||
"https://androiddev.social/users/msfjarvis",
|
||||
],
|
||||
links: [
|
||||
{
|
||||
rel: "http://webfinger.net/rel/profile-page",
|
||||
type: "text/html",
|
||||
href: "https://androiddev.social/@msfjarvis",
|
||||
},
|
||||
{
|
||||
rel: "self",
|
||||
type: "application/activity+json",
|
||||
href: "https://androiddev.social/users/msfjarvis",
|
||||
},
|
||||
{
|
||||
rel: "http://ostatus.org/schema/1.0/subscribe",
|
||||
template: "https://androiddev.social/authorize_interaction?uri={uri}",
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue