diff options
author | Vitaly Takmazov | 2024-10-10 23:35:58 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-10-10 23:35:58 +0300 |
commit | f604b358c38984cc6520c9f0e943b7b6219fe927 (patch) | |
tree | 99f624b3b6736d63860c5df40636e242e116d1b4 /vnext/server | |
parent | 61df600097ced1bd506822a8efd71ec818b84695 (diff) |
vnext: `/api/v2/instance` Mastodon API endpoint
Diffstat (limited to 'vnext/server')
-rw-r--r-- | vnext/server/index.js | 5 | ||||
-rw-r--r-- | vnext/server/middleware/mastodon.js | 15 |
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' + } + }) +} |