Closed pengzhanlee closed 8 years ago
You'd need to modify the ApiClient.js. By default it calls a function called formatUrl which appends the '/api/' in front of any value it is passed. You;d need to provide a way to override that.
Can you say more as to what you are trying to do? Are you trying to call an external api?
thanks for taking the time to answer my questions.
I modified the formatUrl function in ApiClient.js
function formatUrl(path) { return 'http://api.com/' + path; }
And call the api in src/redux/modules/someModule
return client.get('/some/api');
it works now!
It seems like the files in api/actions/foo/bar are used for mock data?
one another question is should I define both action add reducer in redux/modules/someModule?
Hi All,
in api/actions/loadInfo.js
how can i call real api here instead of return a json ? such as:
return fetch('http://api-server.com/someapi/');