Add basic nodeinfo.
This commit is contained in:
parent
340244cdab
commit
d90c8ded64
2 changed files with 54 additions and 0 deletions
20
routes/.well-known/nodeinfo.js
Normal file
20
routes/.well-known/nodeinfo.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
'use strict';
|
||||
|
||||
const express = require('express');
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* @param {express.IRoute} routeObj
|
||||
*/
|
||||
route: (routeObj) => {
|
||||
routeObj.get(async (req, res, _next) => {
|
||||
res.json({
|
||||
"links": [{
|
||||
"rel": "http://nodeinfo.diaspora.software/ns/schema/2.0",
|
||||
"href": `https://${req.headers.host}/nodeinfo/2.0`
|
||||
}]
|
||||
});
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
};
|
34
routes/nodeinfo/2.0.js
Normal file
34
routes/nodeinfo/2.0.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
'use strict';
|
||||
|
||||
const express = require('express');
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* @param {express.IRoute} routeObj
|
||||
*/
|
||||
route: (routeObj) => {
|
||||
routeObj.get(async (req, res, _next) => {
|
||||
res.header("content-type", "application/json; profile=\"http://nodeinfo.diaspora.software/ns/schema/2.0#\"");
|
||||
res.json({
|
||||
version: "2.0",
|
||||
software: {
|
||||
name: "haxsocial",
|
||||
// TODO: Include a git depth and revision hash.
|
||||
version: "0.0.0"
|
||||
},
|
||||
protocols: [
|
||||
"activitypub"
|
||||
],
|
||||
services: {
|
||||
outbound: [],
|
||||
inbound: []
|
||||
},
|
||||
usage: {
|
||||
},
|
||||
openRegistrations: false,
|
||||
metadata: {}
|
||||
});
|
||||
res.end();
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue