File tree Expand file tree Collapse file tree 6 files changed +56
-1
lines changed Expand file tree Collapse file tree 6 files changed +56
-1
lines changed Original file line number Diff line number Diff line change
1
+ This directory contains config with environment variables.
2
+ The directory `` environment `` contains 3 files :
3
+ - `` dev.config `` : contains development environment variables
4
+ - `` production.config `` : contains production environment variables
5
+ - `` staging.config `` : contains beta tests environment variables
6
+
7
+ ####Usage
8
+ ```
9
+ import config from 'App/Config/config'
10
+
11
+ ...
12
+ let uri = config.API_URL
13
+ ...
14
+ ```
Original file line number Diff line number Diff line change
1
+ const config = {
2
+ APP_ID : 'com.tcm.boilerplate' ,
3
+ APP_ENV : 'development' ,
4
+ APP_VERSION : '0.1.0' ,
5
+ APP_BUILD : '1' ,
6
+ API_URL : 'https://query.yahooapis.com/v1/public/' ,
7
+ API_PREFIX : 'api' ,
8
+ }
9
+
10
+ export default config
Original file line number Diff line number Diff line change
1
+ const config = {
2
+ APP_ID : 'com.tcm.boilerplate' ,
3
+ APP_ENV : 'development' ,
4
+ APP_VERSION : '0.1.0' ,
5
+ APP_BUILD : '1' ,
6
+ API_URL : 'https://query.yahooapis.com/v1/public/' ,
7
+ API_PREFIX : 'api' ,
8
+ }
9
+
10
+ export default config
Original file line number Diff line number Diff line change
1
+ const config = {
2
+ APP_ID : 'com.tcm.boilerplate' ,
3
+ APP_ENV : 'production' ,
4
+ APP_VERSION : '0.1.0' ,
5
+ APP_BUILD : '1' ,
6
+ API_URL : 'https://query.yahooapis.com/v1/public/' ,
7
+ API_PREFIX : 'api' ,
8
+ }
9
+
10
+ export default config
Original file line number Diff line number Diff line change
1
+ const config = {
2
+ APP_ID : 'com.tcm.boilerplate' ,
3
+ APP_ENV : 'staging' ,
4
+ APP_VERSION : '0.1.0' ,
5
+ APP_BUILD : '1' ,
6
+ API_URL : 'https://query.yahooapis.com/v1/public/' ,
7
+ API_PREFIX : 'api' ,
8
+ }
9
+
10
+ export default config
Original file line number Diff line number Diff line change 1
1
import { create } from 'apisauce'
2
+ import config from 'App/Config/config'
2
3
3
4
const weatherApiClient = create ( {
4
- baseURL : 'https://query.yahooapis.com/v1/public/' ,
5
+ baseURL : config . API_URL ,
5
6
headers : {
6
7
Accept : 'application/json' ,
7
8
'Content-Type' : 'application/json' ,
You can’t perform that action at this time.
0 commit comments