forked from thecodingmachine/react-native-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '7-gerer-la-configuration' into 'master'
Resolve "Gérer la configuration" Closes thecodingmachine#7 See merge request tcm-projects/react-native-boilerplate!15
- Loading branch information
Showing
6 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
This directory contains configuration variables in 3 files: | ||
- `index.dev.js` : contains development variables | ||
- `index.production.js` : contains production variables | ||
- `index.staging.js` : contains beta tests variables | ||
|
||
You need to create `index.js` by copying the right file. | ||
|
||
#### Warning | ||
Each time you need to build, you need to verify if your `index.js` is the right one. | ||
For example, during development, before building your app do: | ||
``` | ||
cp App\Config\index.dev.js App\Config\index.js | ||
``` | ||
In other environment, you must pay attention to change your `index.js` with the good one. | ||
Also, make sure you add each configuration variable in each configuration file. | ||
|
||
#### Usage | ||
``` | ||
import Config from 'App/Config' | ||
... | ||
let uri = Config.API_URL | ||
... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const Config = { | ||
API_URL: 'https://query.yahooapis.com/v1/public/', | ||
API_PREFIX: 'api', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const Config = { | ||
API_URL: 'https://query.yahooapis.com/v1/public/', | ||
API_PREFIX: 'api', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const Config = { | ||
API_URL: 'https://query.yahooapis.com/v1/public/', | ||
API_PREFIX: 'api', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters