Webfinger for instance actor.

This commit is contained in:
Andrew Pietila 2023-03-21 07:27:30 -05:00
parent c4882652e5
commit 1e8d9dfe06

View file

@ -0,0 +1,30 @@
const express = require('express');
module.exports = {
/**
* @param {express.Request} req
* @param {express.Response} res
* @param {express.NextFunction} _next
*/
get: async (req, res, _next) => {
res.setHeader("content-type", "application/jrd+json");
res.json(
{
"subject": `acct:${req.headers.host}@${req.headers.host}`,
"aliases": [`https://${req.headers.host}/actor`],
"links": [
{
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html",
"href": `https://${req.headers.host}/about/more?instance_actor=true`
},
{
"rel": "self",
"type": "application/activity+json",
"href": `https://${req.headers.host}/actor`
}
]
}
)
}
}