48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
/**
|
|
* @glam/api-client - API configuration
|
|
*/
|
|
|
|
export interface ApiConfig {
|
|
/** FastAPI main backend */
|
|
mainApi: string;
|
|
/** FastAPI geocoding service */
|
|
geoApi: string;
|
|
/** Oxigraph SPARQL endpoint */
|
|
sparqlEndpoint: string;
|
|
/** DuckLake analytics API */
|
|
ducklakeApi: string;
|
|
/** Qdrant vector search */
|
|
qdrantApi: string;
|
|
}
|
|
|
|
/**
|
|
* Default API configuration for local development
|
|
*/
|
|
export const defaultConfig: ApiConfig = {
|
|
mainApi: 'http://localhost:8000',
|
|
geoApi: 'http://localhost:8002',
|
|
sparqlEndpoint: 'http://localhost:7878',
|
|
ducklakeApi: 'http://localhost:8765',
|
|
qdrantApi: 'http://localhost:6333',
|
|
};
|
|
|
|
/**
|
|
* Production API configuration
|
|
*/
|
|
export const productionConfig: ApiConfig = {
|
|
mainApi: 'https://api.bronhouder.nl',
|
|
geoApi: 'https://geo.bronhouder.nl',
|
|
sparqlEndpoint: 'https://sparql.bronhouder.nl',
|
|
ducklakeApi: 'https://analytics.bronhouder.nl',
|
|
qdrantApi: 'https://search.bronhouder.nl',
|
|
};
|
|
|
|
/**
|
|
* Get API config based on environment
|
|
*/
|
|
export function getApiConfig(): ApiConfig {
|
|
if (typeof window !== 'undefined' && window.location.hostname !== 'localhost') {
|
|
return productionConfig;
|
|
}
|
|
return defaultConfig;
|
|
}
|