mirror of
https://github.com/fenwick67/mastofeed
synced 2024-12-22 07:16:14 +01:00
implement basic webfinger
This commit is contained in:
parent
a7e88dffbb
commit
b171ba34a4
34
index.js
34
index.js
@ -175,6 +175,40 @@ app.get('/actor', logger, function(req,res){
|
|||||||
res.send(JSON.stringify(j,null,2));
|
res.send(JSON.stringify(j,null,2));
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.get('/.well-known/webfinger', function(req,res){
|
||||||
|
let domainName = apCryptoShit.getDomainName();
|
||||||
|
if (req.query.resource == `acct:${domainName}@${domainName}`){
|
||||||
|
res.setHeader("content-type","application/jrd+json; charset=utf-8");
|
||||||
|
var resJson = {
|
||||||
|
"subject": `acct:${domainName}@${domainName}`,
|
||||||
|
"aliases": [
|
||||||
|
`https://${domainName}/actor`
|
||||||
|
],
|
||||||
|
"links": [
|
||||||
|
{
|
||||||
|
"rel": "http://webfinger.net/rel/profile-page",
|
||||||
|
"type": "text/html",
|
||||||
|
"href": `https://${domainName}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rel": "self",
|
||||||
|
"type": "application/activity+json",
|
||||||
|
"href": `https://${domainName}/actor`
|
||||||
|
}
|
||||||
|
// ,
|
||||||
|
// {
|
||||||
|
// "rel": "http://ostatus.org/schema/1.0/subscribe",
|
||||||
|
// "template": "https://mastodon.social/authorize_interaction?uri={uri}"
|
||||||
|
// }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
return res.send(JSON.stringify(resJson));
|
||||||
|
} else {
|
||||||
|
res.status(404);
|
||||||
|
res.send();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
app.listen(process.env.PORT || 8080,function(){
|
app.listen(process.env.PORT || 8080,function(){
|
||||||
console.log('Mastofeed started, listening on '+(process.env.PORT || 8080));
|
console.log('Mastofeed started, listening on '+(process.env.PORT || 8080));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user