From 1eac455507b75c0795c169d92e1ce9bb36733209 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 21 Oct 2024 03:59:49 +0300 Subject: vnext: `postgres` -> `sequelize` * implement `active_month` field for Mastodon `/api/v2/instance` endpoint --- vnext/server/middleware/mastodon.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vnext/server/middleware') 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 + } } }) } -- cgit v1.2.3