MCPcopy Create free account
hub / github.com/daboigbae/react-native-template / _setupClient

Method _setupClient

template/src/api/client/client.ts:37–46  ·  view source on GitHub ↗
(appConfig: AxiosRequestConfig)

Source from the content-addressed store, hash-verified

35
36 // sets up the client with the given configuration
37 private _setupClient(appConfig: AxiosRequestConfig) {
38 const config: AxiosRequestConfig = cloneDeep(appConfig);
39
40 config.headers = mapKeys(config.headers, (_, key) => key.toLowerCase());
41
42 defaults(config.headers, {
43 "content-type": "application/json",
44 });
45 return axios.create(config);
46 }
47
48 // sets the bearer token for the client
49 public setBearerToken(token: string) {

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected