Update API URL in version fetcher and enhance logging
Deploy to Production / deploy (push) Successful in 5s

This commit is contained in:
Илья Глазунов
2025-12-07 23:10:01 +03:00
parent 769a5e0a43
commit 7e1846276e
2 changed files with 15 additions and 4 deletions
+5 -4
View File
@@ -5,10 +5,11 @@
(function() {
'use strict';
const API_URL = 'https://git.pyserve.org/api/v1/repos/Shifty/pyserveX/releases/latest';
const API_URL = '/api/version';
const VERSION_ELEMENT_ID = 'current-version';
const CACHE_KEY = 'pyserve_version_cache';
const CACHE_DURATION = 3600000;
const CACHE_DURATION = 3600000; // 1 hour
const FALLBACK_VERSION = '0.9.10';
async function fetchLatestVersion() {
@@ -29,7 +30,7 @@
if (data.tag_name) {
const version = data.tag_name.replace(/^v/, '');
console.log(`✓ Version fetched from Gitea API: ${version}`);
console.log(`✓ Version fetched from API: ${version}`);
return version;
}
@@ -37,7 +38,7 @@
return null;
} catch (error) {
console.warn('API fetch error:', error.message);
console.error('API fetch error:', error.message);
return null;
}
}