tronscan-node-client
tronscan-node-client copied to clipboard
Make `ApiClient` injectable
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.
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