tronscan-node-client icon indicating copy to clipboard operation
tronscan-node-client copied to clipboard

Make `ApiClient` injectable

Open jakeonchain opened this issue 6 years ago • 1 comments

Because not all app can environment variable API_URL. For example, create-react-app can't set that variable. To make apiUrl be injectable for ApiClient, we can pass in a parameter apiUrl. If that's null or undefined, it won't change any behaviour as current. So there is no breaking changes.

jakeonchain avatar Jul 14 '18 12:07 jakeonchain

There is a restriction of create-react-app, All the environment variables must start with REACT_APP_ please have a look at https://github.com/facebook/create-react-app/issues/102#issuecomment-260958485 and https://medium.com/@tacomanator/environments-with-create-react-app-7b645312c09d

jakeonchain avatar Jul 14 '18 13:07 jakeonchain