Enhance FaceAI integration with live checks and metadata handling
All checks were successful
Publish FaceAI Container / publish (push) Successful in 3m22s
All checks were successful
Publish FaceAI Container / publish (push) Successful in 3m22s
- Added optional live FaceAI checks in README.md - Implemented relative storage segment parsing in race-storage.js - Updated server.js to include relative directory in race storage - Refactored legacyAssets.js to resolve asset base URL dynamically - Expanded live race tests to validate FaceAI app launch and metadata - Introduced portrait image handling for live upload flow - Updated faceai_handoff.php to process race storage relative directory
This commit is contained in:
parent
c88b373c73
commit
bb60201ad4
9 changed files with 214 additions and 25 deletions
|
|
@ -1,4 +1,33 @@
|
|||
const legacyAssetBaseUrl = (import.meta.env.VITE_LEGACY_ASSET_BASE_URL || '/legacy-static').replace(/\/$/, '');
|
||||
import { getLegacyBaseUrl } from './legacyUrls.js';
|
||||
|
||||
const localHostnames = new Set(['localhost', '127.0.0.1', '::1']);
|
||||
|
||||
function trimTrailingSlash(value) {
|
||||
return String(value || '').replace(/\/$/, '');
|
||||
}
|
||||
|
||||
function currentHostname() {
|
||||
if (typeof window === 'undefined' || !window.location || !window.location.hostname) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return window.location.hostname.toLowerCase();
|
||||
}
|
||||
|
||||
function resolveLegacyAssetBaseUrl() {
|
||||
const configuredAssetBaseUrl = trimTrailingSlash(import.meta.env.VITE_LEGACY_ASSET_BASE_URL || '');
|
||||
if (configuredAssetBaseUrl) {
|
||||
return configuredAssetBaseUrl;
|
||||
}
|
||||
|
||||
if (localHostnames.has(currentHostname())) {
|
||||
return '/legacy-static';
|
||||
}
|
||||
|
||||
return getLegacyBaseUrl();
|
||||
}
|
||||
|
||||
const legacyAssetBaseUrl = resolveLegacyAssetBaseUrl();
|
||||
|
||||
export function legacyAsset(path) {
|
||||
return `${legacyAssetBaseUrl}${path.startsWith('/') ? path : `/${path}`}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue