Skip to content

Commit 27fa4a2

Browse files
author
Matthieu Napoli
committed
Document to create the configuration file
1 parent 9172304 commit 27fa4a2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

App/Service/WeatherService.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { create } from 'apisauce'
22
import { Config } from 'App/Config'
33

44
const weatherApiClient = create({
5+
/**
6+
* Import the config from the App/Config/index.js file
7+
*/
58
baseURL: Config.API_URL,
69
headers: {
710
Accept: 'application/json',

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The boilerplate will follow new React-Native releases as soon as libraries and t
2424
## Directory layout
2525

2626
- [`App/Components`](App/Components): presentational components
27+
- [`App/Config`](App/Config): configuration of the application
2728
- [`App/Containers`](App/Containers): container components
2829
- [`App/Images`](App/Images): images used by the application
2930
- [`App/Stores`](App/Stores): redux [actions, reducers and stores](https://redux.js.org/basics)
@@ -41,22 +42,26 @@ You also need to install the dependencies required by React Native:
4142
- for [Android development](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-3)
4243
- for [iOS development](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies)
4344

44-
## Usage
45+
## Using the boilerplate
4546

4647
To create a new project using the boilerplate:
4748

4849
- clone this repository
4950
- remove the previous git history: `rm -rf .git/`
51+
- install the npm dependencies by running `yarn`
5052
- rename the React Native project to your own project name: `npm run rename -- <YourProjectName>` (the default name is `Boilerplate`)
51-
- remove the LICENSE file and the License section from the README if your project is not open source
53+
- remove the LICENSE file and the "License" section from the README if your project is not open source
5254

53-
Feel free to remove this section from the README as you will no longer need it in your project. You are encouraged to keep the rest of the documentation in your project so that it is self-explanatory.
55+
Feel free to remove the section "Using the boilerplate" from the README (you will not need it anymore in your project). You are encouraged to keep the rest of the documentation in your project so that it is self-explanatory.
56+
57+
You can now create a new git repository for your project (using `git init`) and create the first commit.
5458

5559
## Running the project
5660

5761
Assuming you have all the requirements installed, you can setup and run the project by running:
5862

5963
- `yarn install` to install the dependencies
64+
- create your [configuration file `App/Config/index.js`](App/Config) from `index.dev.js` (in you are in dev environment) and fill the missing values
6065
- `react-native run-android` to run the Android application (remember to start a simulator or connect an Android phone)
6166
- `react-native run-ios` to run the iOS application (remember to start a simulator or connect an iPhone phone)
6267

0 commit comments

Comments
 (0)