Files
faunosteo/src/config/env.ts
T
Bastien ChanotandClaude Opus 4.6 2d6ed809e2 chore: rename Zoosteo → Faunosteo across entire project
Brand strings, config defaults, i18n dicts, PDF attachment metadata,
HTML titles, Docker container name, package name, repo URLs, deploy
paths, and all documentation updated. Git remote switched to
faunosteo.git. Domain URLs (zoosteo.fr) preserved — DNS update is
separate. 155/155 tests green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 21:44:21 +02:00

53 lines
1.2 KiB
TypeScript

/// <reference types="vite/client" />
/**
* Runtime application config.
* Resolution order:
* 1. window.__APP_CONFIG__ (injected by docker/entrypoint.sh)
* 2. import.meta.env.VITE_APP_* (build-time Vite defines)
* 3. Hard-coded defaults
*/
export interface AppConfig {
siteName: string
brandName: string
footerName: string
tagline: string
}
declare global {
interface Window {
__APP_CONFIG__?: Partial<AppConfig>
}
}
const DEFAULTS: AppConfig = {
siteName: 'Faunosteo',
brandName: 'Faunosteo',
footerName: 'Faunosteo',
tagline: "Bilans d'ostéopathie animalière",
}
function resolveConfig(): AppConfig {
const runtime = typeof window !== 'undefined' ? window.__APP_CONFIG__ : {}
return {
siteName:
runtime?.siteName ??
import.meta.env.VITE_APP_SITE_NAME ??
DEFAULTS.siteName,
brandName:
runtime?.brandName ??
import.meta.env.VITE_APP_BRAND_NAME ??
DEFAULTS.brandName,
footerName:
runtime?.footerName ??
import.meta.env.VITE_APP_FOOTER_NAME ??
DEFAULTS.footerName,
tagline:
runtime?.tagline ??
import.meta.env.VITE_APP_TAGLINE ??
DEFAULTS.tagline,
}
}
export const appConfig: AppConfig = resolveConfig()