Phase 3 - Frontend Multi-Vertical Support: - Add VerticalContext for band state management - Add BandSelector dropdown component - Create dynamic [vertical] routes for shows, songs, venues - Update navbar to use band selector and vertical-aware links - Update api-config.ts for Fediversion domain - Rebrand from Elmeg to Fediversion
19 lines
654 B
TypeScript
19 lines
654 B
TypeScript
export function getApiUrl() {
|
|
if (typeof window === 'undefined') {
|
|
// Server-side
|
|
return process.env.INTERNAL_API_URL || 'http://localhost:8000'
|
|
}
|
|
// Client-side
|
|
const hostname = window.location.hostname
|
|
if (hostname === 'fediversion.xyz' || hostname === 'fediversion.runfoo.run' ||
|
|
hostname === 'elmeg.xyz' || hostname === 'elmeg.runfoo.run') {
|
|
return '/api'
|
|
}
|
|
return process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000'
|
|
}
|
|
|
|
// Get API URL with vertical scope
|
|
export function getVerticalApiUrl(verticalSlug: string) {
|
|
const base = getApiUrl()
|
|
return `${base}/v/${verticalSlug}`
|
|
}
|