[mirotalksfu] - #115 Added the ability to enable or disable stats from the config.js file

هذا الالتزام موجود في:
Miroslav Pejic
2023-08-01 08:52:58 +02:00
الأصل e983a371d2
التزام e2c97a01bc
4 ملفات معدلة مع 47 إضافات و7 حذوفات

عرض الملف

@@ -124,6 +124,13 @@ if (sentryEnabled) {
*/
}
// Stats
const defaultStats = {
enabled: true,
src: 'https://stats.mirotalk.com/script.js',
id: '41d26670-f275-45bb-af82-3ce91fe57756',
};
// OpenAI/ChatGPT
let chatGPT;
if (config.chatGPT.enabled) {
@@ -319,6 +326,13 @@ function startServer() {
res.sendFile(views.about);
});
// Get stats endpoint
app.get(['/stats'], (req, res) => {
const stats = config.stats ? config.stats : defaultStats;
// log.debug('Send stats', stats);
res.send(stats);
});
// ####################################################
// API
// ####################################################