mirror of
https://github.com/Viren070/tmdb-addon.git
synced 2025-12-01 23:18:11 +01:00
caf860aa85
- Add Mixpanel API integration to track addon installations - Implement /api/stats endpoint to fetch installation statistics - Display the number of unique users in the settings page - Improve data handling to prevent parsing errors
20 lines
659 B
JavaScript
20 lines
659 B
JavaScript
const addon = require('./index.js')
|
|
const PORT = process.env.PORT
|
|
const analyticsMiddleware = require('./middleware/analytics.middleware');
|
|
const analytics = require('./utils/analytics');
|
|
|
|
addon.listen(PORT, function () {
|
|
console.log(`Addon active on port ${PORT}.`);
|
|
console.log(`http://127.0.0.1:${PORT}/`);
|
|
});
|
|
|
|
addon.use(analyticsMiddleware());
|
|
|
|
addon.get('/configure', (req, res, next) => {
|
|
analytics.trackInstall({
|
|
language: req.query.language || 'en',
|
|
catalogs: req.query.catalogs ? req.query.catalogs.split(',') : [],
|
|
integrations: req.query.integrations ? req.query.integrations.split(',') : []
|
|
});
|
|
next();
|
|
}); |