mirror of
https://github.com/mileswolfallen2/miles-web.git
synced 2026-12-05 00:00:41 +00:00
update
This commit is contained in:
1 parent
c250653961
commit
f26fdd9d07
18 files changed
+493
-83
No files matched your search
+14
-1
@@ -23,8 +23,21 @@
|
||||
];
|
||||
if (skip.some(function (pattern) { return pattern.test(path); })) return;
|
||||
|
||||
function defaultEndpoint() {
|
||||
if (window.MILES_API_URL) return window.MILES_API_URL + '/analytics/hit';
|
||||
var metaBase = document.querySelector('meta[name="miles-api-base"]');
|
||||
if (metaBase && metaBase.getAttribute('content')) {
|
||||
return metaBase.getAttribute('content').replace(/\/+$/, '') + '/api/analytics/hit';
|
||||
}
|
||||
var host = window.location.hostname;
|
||||
if (host === 'milesallen.site' || host === 'www.milesallen.site') {
|
||||
return 'https://api.milesallen.site/api/analytics/hit';
|
||||
}
|
||||
return '/api/analytics/hit';
|
||||
}
|
||||
|
||||
var meta = document.querySelector('meta[name="miles-analytics-endpoint"]');
|
||||
var endpoint = (meta && meta.getAttribute('content')) || '/api/analytics/hit';
|
||||
var endpoint = (meta && meta.getAttribute('content')) || defaultEndpoint();
|
||||
|
||||
var payload = {
|
||||
path: path,
|
||||
|
||||
Reference in new issue
Block a user