Added env file
This commit is contained in:
parent
7c47036543
commit
8b273171f2
4 changed files with 25 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -10,6 +10,8 @@
|
|||
|
||||
/public/gasStations.xml
|
||||
|
||||
.env
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
|
|
18
README.md
18
README.md
|
@ -1,3 +1,21 @@
|
|||
Ce projet a simplement pour but de répertorier l'ensemble des stations essences en France.
|
||||
|
||||
Les données sont basées sur les [Open Data](https://www.prix-carburants.gouv.fr/rubrique/opendata/).
|
||||
|
||||
# Utilisation
|
||||
|
||||
Une fois le projet cloné vous devrez commencer par créer un fichier `.env` qui contiendra des variables d'environnement :
|
||||
|
||||
```
|
||||
REACT_APP_MAPBOX_TOKEN=********
|
||||
REACT_APP_API_URL=********
|
||||
REACT_APP_MAP_RADIUS=20000
|
||||
|
||||
```
|
||||
|
||||
Une fois fait :
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
yarn start
|
||||
```
|
|
@ -23,7 +23,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build && ssh porto 'rm -r www/darkou.fr/carburants/static' && scp -r build/* porto:www/darkou.fr/carburants",
|
||||
"build": "react-scripts build && ssh porto 'rm -r www/darkou.fr/carburants/static www/darkou.fr/carburants/precache-manifest*' && scp -r build/* porto:www/darkou.fr/carburants",
|
||||
"test": "react-scripts test",
|
||||
"lint": "./node_modules/.bin/eslint . --fix",
|
||||
"eject": "react-scripts eject"
|
||||
|
|
|
@ -24,6 +24,6 @@ export const gasTypes = [
|
|||
type: "GPLc"
|
||||
}
|
||||
];
|
||||
export const mapboxToken = 'pk.eyJ1IjoiZGFya291IiwiYSI6ImNrNzkwdmlsdTBtMmwzZnM0ZmI4Z3h4czIifQ.GU2CdcMiKiApHNhI0ylGtQ';
|
||||
export const baseApiUrl = 'https://api.carburants.darkou.fr/v1/';
|
||||
export const radius = 20000;
|
||||
export const mapboxToken = process.env.REACT_APP_MAPBOX_TOKEN;
|
||||
export const baseApiUrl = process.env.REACT_APP_API_URL;
|
||||
export const radius = Number(process.env.REACT_APP_MAP_RADIUS);
|
Loading…
Reference in a new issue