Update API URL in version fetcher and enhance logging
Deploy to Production / deploy (push) Successful in 5s
Deploy to Production / deploy (push) Successful in 5s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user