mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 11:17:29 +02:00
feat: add ap pageviews analytics
This commit is contained in:
@@ -3,11 +3,17 @@
|
||||
const db = require('../database');
|
||||
const meta = require('../meta');
|
||||
const activitypub = require('../activitypub');
|
||||
const analytics = require('../analytics');
|
||||
|
||||
const middleware = module.exports;
|
||||
|
||||
middleware.enabled = async (req, res, next) => next(!meta.config.activitypubEnabled ? 'route' : undefined);
|
||||
|
||||
middleware.pageview = async (req, res, next) => {
|
||||
analytics.apPageView();
|
||||
next();
|
||||
};
|
||||
|
||||
middleware.assertS2S = async function (req, res, next) {
|
||||
// For whatever reason, express accepts does not recognize "profile" as a valid differentiator
|
||||
// Therefore, manual header parsing is used here.
|
||||
|
||||
Reference in New Issue
Block a user