From 7989e90c7e41a10f41487dacbed227f9fc4cf85d Mon Sep 17 00:00:00 2001 From: Jussi Surma-Aho <L4929@student.jamk.fi> Date: Tue, 9 Jul 2019 11:15:48 +0300 Subject: [PATCH] edited Ronnie's IP back to localhost --- src/components/EditGameForm.js | 4 ++-- src/components/GameList.js | 2 +- src/components/LoginForm.js | 2 +- src/components/NewGameForm.js | 2 +- src/components/Player.js | 2 +- src/components/RegisterForm.js | 2 +- src/components/UserMap.js | 6 +++--- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/EditGameForm.js b/src/components/EditGameForm.js index 640b2cc..c755815 100644 --- a/src/components/EditGameForm.js +++ b/src/components/EditGameForm.js @@ -75,7 +75,7 @@ export class EditGameForm extends React.Component { let token = sessionStorage.getItem("token"); // Send Game info to the server - fetch("http://172.20.2.143:5000/game/edit/" + this.props.gameId, { + fetch("http://localhost:5000/game/edit/" + this.props.gameId, { method: "PUT", headers: { Authorization: "Bearer " + token, @@ -102,7 +102,7 @@ export class EditGameForm extends React.Component { } getGameInfo(gameId) { - fetch("http://172.20.2.143:5000/game/" + gameId) + fetch("http://localhost:5000/game/" + gameId) .then(response => response.json()) .then(json => this.handleGameInfo(json)) .catch(error => console.log(error)); diff --git a/src/components/GameList.js b/src/components/GameList.js index 7b4ce4e..e743dbb 100644 --- a/src/components/GameList.js +++ b/src/components/GameList.js @@ -18,7 +18,7 @@ class GameList extends React.Component { } getGames() { - fetch("http://172.20.2.143:5000/game/listgames") + fetch("http://localhost:5000/game/listgames") .then(response => response.json()) .then(games => { this.setState({ diff --git a/src/components/LoginForm.js b/src/components/LoginForm.js index 5bb6d49..7927581 100644 --- a/src/components/LoginForm.js +++ b/src/components/LoginForm.js @@ -38,7 +38,7 @@ export class LoginForm extends React.Component { e.preventDefault(); // Send login info to the server - fetch(`http://172.20.2.143:5000/user/login`, { + fetch(`http://localhost:5000/user/login`, { method: "POST", headers: { Accept: "application/json", diff --git a/src/components/NewGameForm.js b/src/components/NewGameForm.js index 88c9ba5..aeee892 100644 --- a/src/components/NewGameForm.js +++ b/src/components/NewGameForm.js @@ -77,7 +77,7 @@ export class NewGameForm extends React.Component { let token = sessionStorage.getItem("token"); // Send Game info to the server - fetch("http://172.20.2.143:5000/game/new", { + fetch("http://localhost:5000/game/new", { method: "POST", headers: { Authorization: "Bearer " + token, diff --git a/src/components/Player.js b/src/components/Player.js index 5aa7729..15f7a7f 100644 --- a/src/components/Player.js +++ b/src/components/Player.js @@ -12,7 +12,7 @@ class Player extends Component { getPlayers() { fetch( - "http://172.20.2.143:5000/tracking/players/" + this.props.currentGameId, + "http://localhost:5000/tracking/players/" + this.props.currentGameId, { method: "GET", headers: { diff --git a/src/components/RegisterForm.js b/src/components/RegisterForm.js index 67fe80d..3e14df1 100644 --- a/src/components/RegisterForm.js +++ b/src/components/RegisterForm.js @@ -44,7 +44,7 @@ export class RegisterForm extends React.Component { this.handleError("Passwords do not match"); } else { // Send register info to the server - fetch("http://172.20.2.143:5000/user/register", { + fetch("http://localhost:5000/user/register", { method: "POST", headers: { Accept: "application/json", diff --git a/src/components/UserMap.js b/src/components/UserMap.js index b716b2d..22dbbb6 100644 --- a/src/components/UserMap.js +++ b/src/components/UserMap.js @@ -45,7 +45,7 @@ class UserMap extends Component { // otherwise the fetch functions are the same in both if and else. any smarter way to do this? if (isDeleted === true) { fetch( - "http://172.20.2.143:5000/draw/mapdrawing/" + this.props.currentGameId, + "http://localhost:5000/draw/mapdrawing/" + this.props.currentGameId, { method: "PUT", headers: { @@ -63,7 +63,7 @@ class UserMap extends Component { ); } else { fetch( - "http://172.20.2.143:5000/draw/mapdrawing/" + this.props.currentGameId, + "http://localhost:5000/draw/mapdrawing/" + this.props.currentGameId, { method: "PUT", headers: { @@ -87,7 +87,7 @@ class UserMap extends Component { // Get the drawings from the backend and add them to the state, so they can be drawn fetchGeoJSON() { - fetch("http://172.20.2.143:5000/draw/map/" + this.props.currentGameId, { + fetch("http://localhost:5000/draw/map/" + this.props.currentGameId, { method: "GET", headers: { Authorization: "Bearer " + sessionStorage.getItem("token"), -- GitLab