diff --git a/index.js b/index.js index e396fda..5eb404a 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,8 @@ const apex = ActivitypubExpress({ actorParam: 'actor', objectParam: 'id', itemsPerPage: 100, - offlineMode: true, // delivery done in workers only + // delivery done in workers only in production + offlineMode: process.env.NODE_ENV === 'production', routes }) @@ -174,6 +175,16 @@ app.get('/groups', (req, res, next) => { return res.status(500).send() }) }) +app.get('/stats', async (req, res, next) => { + try { + const queueSize = await apex.store.db.collection('deliveryQueue') + .countDocuments({ attempt: 0 }) + const uptime = process.uptime() + res.json({ queueSize, uptime }) + } catch (err) { + next(err) + } +}) app.use(function (err, req, res, next) { console.error(err.message, req.body, err.stack) diff --git a/web/src/App.vue b/web/src/App.vue index cf5f527..9b643c1 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,8 +1,12 @@ + + diff --git a/web/src/views/Home.vue b/web/src/views/Home.vue index 557505c..016468b 100644 --- a/web/src/views/Home.vue +++ b/web/src/views/Home.vue @@ -22,6 +22,7 @@
  • Visit a @{{ domain }} group profile to see the group history
  • Active Groups

    +

    Top 50 groups with the most recent posts