Webfinger for instance actor.
This commit is contained in:
parent
c4882652e5
commit
1e8d9dfe06
1 changed files with 30 additions and 0 deletions
30
routes/.well-known/webfinger.js
Normal file
30
routes/.well-known/webfinger.js
Normal 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`
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue