aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/middleware/mastodon.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/server/middleware/mastodon.js')
-rw-r--r--vnext/server/middleware/mastodon.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/vnext/server/middleware/mastodon.js b/vnext/server/middleware/mastodon.js
new file mode 100644
index 00000000..e29fd736
--- /dev/null
+++ b/vnext/server/middleware/mastodon.js
@@ -0,0 +1,23 @@
+import { getMonthlyActiveUsers } from '../db/Users'
+
+/**
+ * Return content for embedding
+ * @type {import('express').RequestParamHandler}
+ */
+export const instance = async (req, res) => {
+ const activeUsers = await getMonthlyActiveUsers()
+ res.json({
+ 'domain': 'juick.com',
+ 'title': 'Microblogging service',
+ 'description': 'Juick',
+ 'version': '2.x',
+ 'contact': {
+ 'email': 'support@juick.com'
+ },
+ 'usage': {
+ 'users': {
+ 'active_month': activeUsers
+ }
+ }
+ })
+}