aboutsummaryrefslogtreecommitdiff
path: root/vnext/server
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server')
-rw-r--r--vnext/server/index.js5
-rw-r--r--vnext/server/middleware/mastodon.js15
2 files changed, 20 insertions, 0 deletions
diff --git a/vnext/server/index.js b/vnext/server/index.js
index 692fbd76..eaf1ae8a 100644
--- a/vnext/server/index.js
+++ b/vnext/server/index.js
@@ -10,6 +10,7 @@ import event from './middleware/event'
import oembed from './middleware/oembed'
import urlExpand from './middleware/urlexpand'
import releases from './middleware/android'
+import { instance } from './middleware/mastodon'
const PORT = process.env.LISTEN_PORT || 8081
import path from 'path'
@@ -26,6 +27,10 @@ router.get('/api/v2/oembed', oembed)
router.get('/api/v2/urlexpand', urlExpand)
router.get('/api/apps/android/releases', releases)
+// Mastodon API
+
+router.get('/api/v2/instance', instance)
+
const durov_webhook = webhookPath()
if (durov_webhook) {
router.post(`/api/v2/${durov_webhook}`, webhook)
diff --git a/vnext/server/middleware/mastodon.js b/vnext/server/middleware/mastodon.js
new file mode 100644
index 00000000..3bbad3c4
--- /dev/null
+++ b/vnext/server/middleware/mastodon.js
@@ -0,0 +1,15 @@
+/**
+ * Return content for embedding
+ * @type {import('express').RequestParamHandler}
+ */
+export const instance = async (req, res) => {
+ res.json({
+ 'domain': 'juick.com',
+ 'title': 'Microblogging service',
+ 'description': 'Juick',
+ 'version': '2.x',
+ 'contact': {
+ 'email': 'support@juick.com'
+ }
+ })
+}