From 0aecaccbf5338762304b12808f5dbce4c1f88331 Mon Sep 17 00:00:00 2001 From: Janne <janjan.sirvio@gmail.com> Date: Thu, 27 Feb 2020 14:17:03 +0200 Subject: [PATCH] Changed the backend url in the correct form for production build --- src/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 2e141cb..10c3ec0 100644 --- a/src/App.js +++ b/src/App.js @@ -25,7 +25,7 @@ class App extends React.Component { async getDataFromServer(){ try { // Get data from the backend - let res = await axios.get('http://localhost:3001/score/get') + let res = await axios.get('/score/get') let data = res.data console.log(`Data: ${data}`); @@ -53,10 +53,10 @@ class App extends React.Component { const usernameObject = { username: this.state.username } - res = await axios.post('http://localhost:3001/button/push', usernameObject) + res = await axios.post('/button/push', usernameObject) } else{ - res = await axios.post('http://localhost:3001/button/push') + res = await axios.post('/button/push') } let data = res.data -- GitLab