Skip to content

Commit

Permalink
Fix for environment variables
Browse files Browse the repository at this point in the history
Signed-off-by: Pierrick <mulotmail@gmail.com>
  • Loading branch information
PierrickP committed Jun 22, 2023
1 parent a6e127b commit 82a9aa2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ coverage
.netlify

functions/*.zip

.env
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@ git clone https://github.com/fluctuo/gbfs-validator.git
cd gbfs-validator
```

### Set Environment variables

Copy `./website/.env.exemple` to `./website/.env`
And set values

### Run dev environment

With Node.js

```shell
yarn
yarn start
yarn run dev
```

Open `localhost:8080` on your browser
Expand All @@ -83,6 +88,7 @@ Open `localhost:8080` on your browser
This project follows the [all-contributors](https://allcontributors.org/docs/en/overview) specification, find the [emoji key here](https://allcontributors.org/docs/en/emoji-key). Contributions of any kind welcome! Please check out our [Contribution guidelines](/CONTRIBUTING.md) for details.

:warning: for contributions on schemas, please see [Versions README](gbfs-validator/versions/README.md)

## Acknowledgements

This project was originally created by Pierrick Paul at [fluctuo](https://fluctuo.com/) - MobilityData started maintaining the project in September 2021.
5 changes: 5 additions & 0 deletions website/.env.exemple
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Mapbox token (Required for visualization / public scopes)
VITE_MAPBOX_API_KEY=

# Google Analytics ID (Optionnal)
VITE_GOOGLE_ANALYTICS_ID=
4 changes: 2 additions & 2 deletions website/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import 'maplibre-gl/dist/maplibre-gl.css'

import router from './router'

if (import.meta.env.VUE_APP_GOOGLE_ANALYTICS_ID) {
if (import.meta.env.VITE_GOOGLE_ANALYTICS_ID) {
Vue.use(VueGtag, {
config: { id: import.meta.env.VUE_APP_GOOGLE_ANALYTICS_ID }
config: { id: import.meta.env.VITE_GOOGLE_ANALYTICS_ID }
})
}

Expand Down
3 changes: 1 addition & 2 deletions website/src/pages/Visualization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ let vehiclesOverlay
let stationsOverlay
let geofencingOverlay
const MAPBOX_KEY =
'pk.eyJ1IjoicGllcnJpY2twIiwiYSI6ImNsaWluZjl6bDF3emQzZW9iZHZ2NDd5MDMifQ.FCTTnlXknFjxmw9NLemYsQ'
const MAPBOX_KEY = import.meta.env.VITE_MAPBOX_API_KEY
// https://github.com/rowanwins/maplibregl-mapbox-request-transformer
const transformRequest = (url = '', resourceType = '') => {
Expand Down

0 comments on commit 82a9aa2

Please sign in to comment.