feat: Externalize Core API base URL to AppConfig and environment configuration.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"GOOGLE_MAPS_API_KEY": "AIzaSyAyRS9I4xxoVPAX91RJvWJHszB3ZY3-IC0"
|
||||
"GOOGLE_MAPS_API_KEY": "AIzaSyAyRS9I4xxoVPAX91RJvWJHszB3ZY3-IC0",
|
||||
"CORE_API_BASE_URL": "https://krow-core-api-e3g6witsvq-uc.a.run.app"
|
||||
}
|
||||
@@ -5,5 +5,12 @@ class AppConfig {
|
||||
AppConfig._();
|
||||
|
||||
/// The Google Maps API key.
|
||||
static const String googleMapsApiKey = String.fromEnvironment('GOOGLE_MAPS_API_KEY');
|
||||
static const String googleMapsApiKey = String.fromEnvironment(
|
||||
'GOOGLE_MAPS_API_KEY',
|
||||
);
|
||||
|
||||
/// The base URL for the Core API.
|
||||
static const String coreApiBaseUrl = String.fromEnvironment(
|
||||
'CORE_API_BASE_URL',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import '../../../config/app_config.dart';
|
||||
|
||||
/// Constants for Core API endpoints.
|
||||
class CoreApiEndpoints {
|
||||
CoreApiEndpoints._();
|
||||
|
||||
/// The base URL for the Core API.
|
||||
static const String baseUrl = 'https://krow-core-api-e3g6witsvq-uc.a.run.app';
|
||||
static const String baseUrl = AppConfig.coreApiBaseUrl;
|
||||
|
||||
/// Upload a file.
|
||||
static const String uploadFile = '/core/upload-file';
|
||||
|
||||
Reference in New Issue
Block a user