aboutsummaryrefslogtreecommitdiff
path: root/vnext/server
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server')
-rw-r--r--vnext/server/app.js6
-rw-r--r--vnext/server/middleware/host-meta.js17
2 files changed, 21 insertions, 2 deletions
diff --git a/vnext/server/app.js b/vnext/server/app.js
index f8beb933..223868f1 100644
--- a/vnext/server/app.js
+++ b/vnext/server/app.js
@@ -13,7 +13,7 @@ import { instance } from './middleware/mastodon'
import path from 'path'
import { webhook, webhookPath } from './durov'
import { webfinger } from './middleware/webfinger'
-import { jsonMeta, xmlMeta } from './middleware/host-meta'
+import { jsonMeta, nodeinfo, xmlMeta } from './middleware/host-meta'
// initialize the application and create the routes
export const app = express()
@@ -35,6 +35,10 @@ router.get('/.well-known/host-meta.json', jsonMeta)
router.get('/.well-known/webfinger', webfinger)
+// Nodeinfo
+
+router.get('/.well-known/nodeinfo', nodeinfo)
+
// Mastodon API
router.get('/api/v2/instance', instance)
diff --git a/vnext/server/middleware/host-meta.js b/vnext/server/middleware/host-meta.js
index eec7d3e3..fe6ca631 100644
--- a/vnext/server/middleware/host-meta.js
+++ b/vnext/server/middleware/host-meta.js
@@ -15,7 +15,7 @@ export const xmlMeta = async (_req, res) => {
}
/**
- * host-meta endpoint
+ * host-meta.json endpoint
* @type {import('express').RequestParamHandler}
*/
export const jsonMeta = async (_req, res) => {
@@ -28,3 +28,18 @@ export const jsonMeta = async (_req, res) => {
]
})
}
+
+/**
+ * nodeinfo endpoint
+ * @type {import('express').RequestParamHandler}
+ */
+export const nodeinfo = async (_req, res) => {
+ return res.json({
+ 'links': [
+ {
+ 'rel': 'https://nodeinfo.diaspora.software/ns/schema/2.0',
+ 'href': `${baseURL}/.well-known/nodeinfo/2.0`
+ }
+ ]
+ })
+}