Derive API origin from VITE_API_BASE_URL for hotlink image src.

Nest api config (baseUrl + baseUrlRoot) so dev cross-origin /i requests work without a separate app-env flag.
This commit is contained in:
2026-10-27 14:03:30 +01:00
parent dfc52749b2
commit 6407b64f26
3 changed files with 13 additions and 3 deletions
+6 -1
View File
@@ -12,8 +12,13 @@ const envInt = (key: string): number => parseInt(env(key), 10);
const isEnabled = (key: string): boolean => env(key) === 'true';
const apiBaseUrl = env('VITE_API_BASE_URL');
export const config = {
baseUrl: env('VITE_API_BASE_URL'),
api: {
baseUrl: apiBaseUrl,
baseUrlRoot: apiBaseUrl.split('/api')[0]
},
shareOrigins: {
clearnet: `${env('VITE_CLEARNET_SCHEME')}://${env('VITE_CLEARNET_DOMAIN')}`,
onion: `http://${env('VITE_ONION_HOSTNAME')}`