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: {
|
setHeaders: {
|
||||||
...({ 'Content-Type': 'application/json', 'Accept': 'application/json' }),
|
...({ 'Content-Type': 'application/json', 'Accept': 'application/json' }),
|
||||||
},
|
},
|
||||||
url: `${environment.api_url}${req.url}`
|
url: `${environment.apiBaseUrl}${req.url}`
|
||||||
});
|
});
|
||||||
return next(apiReq);
|
return next(apiReq);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production:<boolean> false,
|
// Used by build system to enable dev mode optimizations
|
||||||
api_url:<string> 'http://localhost:3200/api',
|
production: <boolean> false,
|
||||||
api_key:<string> '<YOU-API-KEY-HERE>',
|
// Note: Currently used via apiInterceptor. Deprecated: duplicate of apiUrl, consider removing
|
||||||
use_api_key:<boolean> true,
|
apiBaseUrl: <string> 'http://localhost:3200/api',
|
||||||
refresh_interval:<number> 30000,
|
// Reserved for API key-based authentication (not currently used, see useApiKey)
|
||||||
google_map_api_key:<string> '<YOUR-GOOGLE-MAP-API-KEY-HERE>'
|
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