refactor(environment): rename config keys to camelCase
Aligns environment.* shape with TypeScript convention.
Renames: api_url -> apiBaseUrl, api_key -> apiKey,
use_api_key -> useApiKey, refresh_interval -> refreshInterval,
google_map_api_key -> googleMapApiKey.
The local environment.{ts,development.ts,local.ts} files are
gitignored and have already been migrated; this commit updates
the tracked example file and the only consumer (apiInterceptor).
This commit is contained in:
@@ -7,7 +7,7 @@ export const apiInterceptor: HttpInterceptorFn = (req, next) => {
|
||||
setHeaders: {
|
||||
...({ 'Content-Type': 'application/json', 'Accept': 'application/json' }),
|
||||
},
|
||||
url: `${environment.api_url}${req.url}`
|
||||
url: `${environment.apiBaseUrl}${req.url}`
|
||||
});
|
||||
return next(apiReq);
|
||||
};
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
export const environment = {
|
||||
// Used by build system to enable dev mode optimizations
|
||||
production: <boolean> false,
|
||||
api_url:<string> 'http://localhost:3200/api',
|
||||
api_key:<string> '<YOU-API-KEY-HERE>',
|
||||
use_api_key:<boolean> true,
|
||||
refresh_interval:<number> 30000,
|
||||
google_map_api_key:<string> '<YOUR-GOOGLE-MAP-API-KEY-HERE>'
|
||||
// Note: Currently used via apiInterceptor. Deprecated: duplicate of apiUrl, consider removing
|
||||
apiBaseUrl: <string> 'http://localhost:3200/api',
|
||||
// Reserved for API key-based authentication (not currently used, see useApiKey)
|
||||
apiKey: <string> '<YOU-API-KEY-HERE>',
|
||||
// Reserved for toggling between JWT and API key authentication (not currently used)
|
||||
useApiKey: <boolean> true,
|
||||
// Reserved for data polling/refresh intervals (not currently used)
|
||||
refreshInterval: <number> 30000,
|
||||
// Reserved for Google Maps API integration (not currently used)
|
||||
googleMapApiKey: <string> '<YOUR-GOOGLE-MAP-API-KEY-HERE>'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user