mirror of
https://github.com/Redume/Kekkai.git
synced 2025-03-12 11:34:38 +03:00
Revert "chore(server): Changed the name of the keys. Made it easier to change the domain"
This reverts commit da7134f444
.
This commit is contained in:
parent
8675fd918f
commit
dd73f73869
2 changed files with 11 additions and 6 deletions
|
@ -25,6 +25,7 @@
|
||||||
{
|
{
|
||||||
plausible_domain: plausible.io
|
plausible_domain: plausible.io
|
||||||
plausible_token: TOKEN
|
plausible_token: TOKEN
|
||||||
|
plausiblee_api: https://plausible.io//api/event/
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
currency:
|
currency:
|
||||||
|
|
|
@ -47,11 +47,7 @@ fastify.addHook('onResponse', async (request, reply) => {
|
||||||
|
|
||||||
routePartFiltered.unshift('/');
|
routePartFiltered.unshift('/');
|
||||||
|
|
||||||
if (
|
if (!config?.['analytics']['work'] ? config?.['analytics']['work'] : false)
|
||||||
!config?.['analytics']['enabled']
|
|
||||||
? config?.['analytics']['enabled']
|
|
||||||
: false
|
|
||||||
)
|
|
||||||
return;
|
return;
|
||||||
else if (!fastify.printRoutes().includes(routePartFiltered.at(-1))) return;
|
else if (!fastify.printRoutes().includes(routePartFiltered.at(-1))) return;
|
||||||
|
|
||||||
|
@ -85,6 +81,7 @@ fastify.addHook('onResponse', async (request, reply) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
<<<<<<< HEAD
|
||||||
await axios.post(
|
await axios.post(
|
||||||
`https://${config['analytics']['plausible_domain']}/api/event/`,
|
`https://${config['analytics']['plausible_domain']}/api/event/`,
|
||||||
event,
|
event,
|
||||||
|
@ -94,8 +91,15 @@ fastify.addHook('onResponse', async (request, reply) => {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'User-Agent': userAgent,
|
'User-Agent': userAgent,
|
||||||
},
|
},
|
||||||
|
=======
|
||||||
|
await axios.post(config['analytics']['plausible_api'], event, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${config['analytics']['plausible_token']}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'User-Agent': userAgent,
|
||||||
|
>>>>>>> parent of da7134f (chore(server): Changed the name of the keys. Made it easier to change the domain)
|
||||||
},
|
},
|
||||||
);
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
fastify.log.error('Error sending event to Plausible:', error.message);
|
fastify.log.error('Error sending event to Plausible:', error.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue