diff options
author | Vitaly Takmazov | 2024-10-21 03:59:49 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-10-21 04:12:57 +0300 |
commit | 1eac455507b75c0795c169d92e1ce9bb36733209 (patch) | |
tree | 6c1cd441543982a4ea41ffb63cdf33d5b294ab57 /vnext/server/middleware | |
parent | c7738cdc5d7a63c8cd2609a2e4df9f8d28698608 (diff) |
vnext: `postgres` -> `sequelize`
* implement `active_month` field for Mastodon `/api/v2/instance` endpoint
Diffstat (limited to 'vnext/server/middleware')
-rw-r--r-- | vnext/server/middleware/mastodon.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vnext/server/middleware/mastodon.js b/vnext/server/middleware/mastodon.js index 3bbad3c4..e29fd736 100644 --- a/vnext/server/middleware/mastodon.js +++ b/vnext/server/middleware/mastodon.js @@ -1,8 +1,11 @@ +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', @@ -10,6 +13,11 @@ export const instance = async (req, res) => { 'version': '2.x', 'contact': { 'email': 'support@juick.com' + }, + 'usage': { + 'users': { + 'active_month': activeUsers + } } }) } |