In redux-api-middleware
we can create a API call like below,
export function loadUsers() {
return {
[CALL_API]: {
headers: { 'Content-Type': 'application/json' },
endpoint: 'http://localhost:1337/users',
method: 'GET',
types: [LOAD_USERS_REQUEST, LOAD_USERS_SUCCESS, LOAD_USERS_FAILURE]
}
}
}
Problem is, for every request, am using the common end point http://localhost:1337
, Header content type and authorization token settings.
I need a place to set those settings globally, from their official documentation am unable to find the solution. Anybody know this? or have any idea to achieve this ?
Thanks in advance..