Skip to content

Commit

Permalink
Set dev and prod env (#10)
Browse files Browse the repository at this point in the history
* add env vars in repo

* test with new repo
  • Loading branch information
aloxe authored May 28, 2024
1 parent 17fb9fc commit 894a461
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# tokens
VITE_MAPBOX_TOKEN='pk.eyJ1IjoiYWxveGUiLCJhIjoid3lBT0poSSJ9.QvBnfWvRrXcHGUQPccVtKA'
VITE_THUNDERFOREST_TOKEN='c49b6e87f82046eda9501fa5f09a2e3a'

# base url
VITE_BASE_URL='/'
6 changes: 6 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# tokens
VITE_MAPBOX_TOKEN='pk.eyJ1IjoiYWxveGUiLCJhIjoid3lBT0poSSJ9.QvBnfWvRrXcHGUQPccVtKA'
VITE_THUNDERFOREST_TOKEN='c49b6e87f82046eda9501fa5f09a2e3a'

# base url
VITE_BASE_URL='/velo/traces/'
2 changes: 1 addition & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install dependencies & yarn build
run: |
yarn install --frozen-lockfile
yarn build
yarn build --mode development
- name: Copy Site recursively to remote
uses: appleboy/scp-action@master
Expand Down
6 changes: 2 additions & 4 deletions src/helpers/gpxUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import axios from 'axios';

export const getGpxList = async () => {
try {
// const response = await axios.get('/api/velotraces/tracks.php');
const response = await axios.get('https://alix.guillard.fr/velotraces/tracks.php');
const response = await axios.get('https://alix.guillard.fr/data/velo/tracks.php');
return response.data
} catch (error) {
console.error('oups Error fetching data:', error.message);
Expand All @@ -31,8 +30,7 @@ export const filterGpxList = (currentYear, currentCountry, allGpxList) => {

export const loadGeoJson = async (url) => {
try {
// const response = await axios.get('/api/velotraces/allvelotracks/'+url);
const response = await axios.get('https://alix.guillard.fr/velotraces/allvelotracks/'+url);
const response = await axios.get('https://alix.guillard.fr/data/velo/gpx/'+url);
const xmlDom = new DOMParser().parseFromString(response.data, 'application/xml');
const geojson = gpx(xmlDom)

Expand Down
1 change: 0 additions & 1 deletion src/routes/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import './App.css'
function App() {
return (
<div className='App'>
<div>{`mode: ${import.meta.env.MODE} image: ${import.meta.env.VITE_BASE_URL}`}</div>
<Wrapper />
</div>
)
Expand Down

0 comments on commit 894a461

Please sign in to comment.