From f740bad99bf28cca591a8da22148ffba27d00e32 Mon Sep 17 00:00:00 2001 From: Lucendio <dev@lucend.io> Date: Sun, 5 Apr 2020 22:03:13 +0200 Subject: [PATCH] [app] Rename and move var that used to set API URL * PUBLIC_URL should now be provided as env var --- app/client/.env.local | 1 - app/client/src/utils/APICalls.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 app/client/.env.local diff --git a/app/client/.env.local b/app/client/.env.local deleted file mode 100644 index 8de3f61..0000000 --- a/app/client/.env.local +++ /dev/null @@ -1 +0,0 @@ -REACT_APP_baseAPIURL=http://localhost:3000 diff --git a/app/client/src/utils/APICalls.js b/app/client/src/utils/APICalls.js index 9951b2f..a54dd81 100644 --- a/app/client/src/utils/APICalls.js +++ b/app/client/src/utils/APICalls.js @@ -1,7 +1,7 @@ import axios from 'axios' const axiosInstance = axios.create({ - baseURL: process.env.REACT_APP_baseAPIURL, + baseURL: process.env.PUBLIC_URL, withCredentials: true, }); @@ -16,7 +16,7 @@ axiosInstance.interceptors.response.use( ); export const signout = () => { - return axiosInstance.post(process.env.REACT_APP_baseAPIURL + '/logout').then(user => { + return axiosInstance.post(process.env.PUBLIC_URL + '/logout').then(user => { // delete axiosInstance.defaults.headers.common["Authorization"]; return user.data }) @@ -93,4 +93,4 @@ export const deleteTodo = (_id) => { }).then(todo => { return todo }) -} +} \ No newline at end of file -- GitLab