diff --git a/client/.env b/client/.env new file mode 100644 index 000000000..c41e3d3e0 --- /dev/null +++ b/client/.env @@ -0,0 +1,2 @@ +REACT_APP_MAPBOX_KEY=pk.eyJ1IjoibWVpcmltIiwiYSI6ImNrbWNjYmlwYjJhYzYycW42NTYzcmdpYWcifQ.lCBjl1gWMI6UxySOCCBUHg +REACT_APP_BASE_API_URL=https://staging-api.meirim.org/api \ No newline at end of file diff --git a/client/.env.production b/client/.env.production new file mode 100644 index 000000000..4394670b6 --- /dev/null +++ b/client/.env.production @@ -0,0 +1 @@ +REACT_APP_BASE_API_URL=https://api.meirim.org/api \ No newline at end of file diff --git a/client/src/components/Map/map.jsx b/client/src/components/Map/map.jsx index b1d2034cf..6fb68d6b9 100644 --- a/client/src/components/Map/map.jsx +++ b/client/src/components/Map/map.jsx @@ -10,7 +10,7 @@ import Mapbox from 'react-map-gl'; import PropTypes from 'prop-types'; mapboxgl.workerClass = MapboxWorker; -const apiKey = process.env.CONFIG.mapboxApiKey; +const apiKey = process.env.REACT_APP_MAPBOX_KEY; export const Map = ({ onMouseMove, id, children, onClick, initialViewState, interactiveLayerIds, style, mapStyle = 'mapbox://styles/mapbox/light-v11' }) => { diff --git a/client/src/services/api.js b/client/src/services/api.js index 9a638652a..39b39a73f 100644 --- a/client/src/services/api.js +++ b/client/src/services/api.js @@ -1,6 +1,9 @@ import axios from 'axios' -const instance = axios.create(process.env.CONFIG.axios) +const instance = axios.create({ + "baseURL": process.env.REACT_APP_BASE_API_URL, + "withCredentials": true +}) export default { get: (path, data, options) => instance.get(path, { params: data }, options) diff --git a/client/src/services/paymentApi.js b/client/src/services/paymentApi.js index d364763d2..b6e2f3a4f 100644 --- a/client/src/services/paymentApi.js +++ b/client/src/services/paymentApi.js @@ -1,8 +1,8 @@ const axios = require('axios'); -const config = process.env.CONFIG.axios; +const config = process.env.REACT_APP_BASE_API_URL const instance = axios.create({ - baseURL: `${config.baseURL}/funding` + baseURL: `${config}/funding` }) module.exports = {