react-native-config/Example
Bartosz Sosnowski 8616212e61
Add Windows support (#492)
Add support for react-native-windows. Update the docs and example and
add an automatic CI test.
2020-09-16 11:28:13 -03:00
..
__tests__ Add Windows support (#492) 2020-09-16 11:28:13 -03:00
android Add compile sdk version in build gradle 2020-07-12 23:41:08 -03:00
ios Update example project to react-native 0.62.2 (#455) 2020-05-19 23:23:11 -03:00
jest-setups Add Windows support (#492) 2020-09-16 11:28:13 -03:00
windows Add Windows support (#492) 2020-09-16 11:28:13 -03:00
.buckconfig bump example to react-native 0.33 2016-09-13 18:39:29 -07:00
.env Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
.env.production Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
.eslintrc.js Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
.flowconfig Update example project to react-native 0.62.2 (#455) 2020-05-19 23:23:11 -03:00
.gitattributes bump example app to 0.50.4 2017-12-04 21:34:37 -08:00
.gitignore Add Windows support (#492) 2020-09-16 11:28:13 -03:00
.prettierrc.js Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
.watchmanconfig Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
App.js Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
README.md Add Windows support (#492) 2020-09-16 11:28:13 -03:00
app.json Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
babel.config.js Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
index.js Update react-native to 0.60.5 2020-03-18 20:43:29 -03:00
metro.config.js Add Windows support (#492) 2020-09-16 11:28:13 -03:00
package.json Add Windows support (#492) 2020-09-16 11:28:13 -03:00
yarn.lock Add Windows support (#492) 2020-09-16 11:28:13 -03:00

README.md

Example app using react-native-config

Just a simple app accessing config variables from .env and .env.production.

Running

By default it will read variables from .env:

$ react-native run-android

To read from another file just specify it with ENVFILE, like:

$ ENVFILE=.env.prod react-native run-android

Running on Windows

To use the default .env file:

npx react-native run-windows

To read from another file:

set ENVFILE=.env.production
npx react-native run-windows

Running from Xcode

Open the Xcode project file in Example/ios/Example.xcodeproj.

Notice there are two schemes setup for the application: "Example" runs the default build, reading vars from .env and "Example (production)" is configured to read from .env.production.