diff --git a/src/components/EditGameForm.js b/src/components/EditGameForm.js index c755815199a7bdba408c8d4206461e6573fed6c8..640b2cc8905a168a5bd5681839ff7e4419e72e01 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://localhost:5000/game/edit/" + this.props.gameId, { + fetch("http://172.20.2.143: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://localhost:5000/game/" + gameId) + fetch("http://172.20.2.143: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 e743dbba76b02cddaffd00d2c26757df71be7f21..7b4ce4e3e60e29c82d3078e537ea4eb34e6561c2 100644 --- a/src/components/GameList.js +++ b/src/components/GameList.js @@ -18,7 +18,7 @@ class GameList extends React.Component { } getGames() { - fetch("http://localhost:5000/game/listgames") + fetch("http://172.20.2.143:5000/game/listgames") .then(response => response.json()) .then(games => { this.setState({ diff --git a/src/components/LoginForm.js b/src/components/LoginForm.js index 3c559b053bd7e78408fcac4f0e2f6aab17bfce08..5bb6d496e1fb2b372f1aa5435c6c1a2ba93d13b0 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(`${process.env.REACT_APP_URL}/user/login`, { + fetch(`http://172.20.2.143:5000/user/login`, { method: "POST", headers: { Accept: "application/json", diff --git a/src/components/NewGameForm.js b/src/components/NewGameForm.js index aeee892c1dc2c7f106470eb93bb12aa31c8410c3..88c9ba5d9e743c1aa6bd238eecf1a83d951a7fac 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://localhost:5000/game/new", { + fetch("http://172.20.2.143:5000/game/new", { method: "POST", headers: { Authorization: "Bearer " + token, diff --git a/src/components/Player.js b/src/components/Player.js index 15f7a7f48c7357e815c30134bd25c7b61b5c3984..5aa7729cd749efc21a0ad09a686df52dc664188c 100644 --- a/src/components/Player.js +++ b/src/components/Player.js @@ -12,7 +12,7 @@ class Player extends Component { getPlayers() { fetch( - "http://localhost:5000/tracking/players/" + this.props.currentGameId, + "http://172.20.2.143:5000/tracking/players/" + this.props.currentGameId, { method: "GET", headers: { diff --git a/src/components/RegisterForm.js b/src/components/RegisterForm.js index 56360b6f7c1565c49aa11d8ad7957ab156c35dce..67fe80d6d48870361a5db9618d7c7f1d29b0ee68 100644 --- a/src/components/RegisterForm.js +++ b/src/components/RegisterForm.js @@ -1,14 +1,14 @@ -import React from 'react'; +import React from "react"; export class RegisterForm extends React.Component { constructor(props) { super(props); this.state = { - errorMsg: '', - username: '', - password: '', - password2: '' + errorMsg: "", + username: "", + password: "", + password2: "" }; } @@ -41,14 +41,14 @@ export class RegisterForm extends React.Component { e.preventDefault(); if (this.state.password !== this.state.password2) { - this.handleError('Passwords do not match'); + this.handleError("Passwords do not match"); } else { // Send register info to the server - fetch('http://localhost:5000/user/register', { - method: 'POST', + fetch("http://172.20.2.143:5000/user/register", { + method: "POST", headers: { - Accept: 'application/json', - 'Content-Type': 'application/json' + Accept: "application/json", + "Content-Type": "application/json" }, body: JSON.stringify({ name: name, @@ -76,28 +76,28 @@ export class RegisterForm extends React.Component { }; componentDidMount() { - document.addEventListener('keyup', this.handleEsc); + document.addEventListener("keyup", this.handleEsc); } componentWillUnmount() { - document.removeEventListener('keyup', this.handleEsc); + document.removeEventListener("keyup", this.handleEsc); } render() { return ( - <div className='fade-main'> - <div className='sticky'> - <span className='close' onClick={this.handleView}> + <div className="fade-main"> + <div className="sticky"> + <span className="close" onClick={this.handleView}> × </span> </div> - <div className='login'> + <div className="login"> <form onSubmit={this.handleRegister}> <h1>register new user</h1> <br /> <input - placeholder='Enter Username' - name='username' + placeholder="Enter Username" + name="username" value={this.state.username} onChange={this.handleChange} autoFocus @@ -105,24 +105,24 @@ export class RegisterForm extends React.Component { /> <br /> <input - placeholder='Enter password' - type='password' - name='password' + placeholder="Enter password" + type="password" + name="password" value={this.state.password} onChange={this.handleChange} required /> <br /> <input - placeholder='Verify password' - type='password' - name='password2' + placeholder="Verify password" + type="password" + name="password2" value={this.state.password2} onChange={this.handleChange} required /> <br /> - <button type='submit'>register</button> + <button type="submit">register</button> <h2>{this.state.errorMsg}</h2> </form> </div> diff --git a/src/components/UserMap.js b/src/components/UserMap.js index 22dbbb66cc08c872820a108643cfc4e9e1fe6b73..b716b2d8df430135dd3ecbd8cf4717dd5a9d6be3 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://localhost:5000/draw/mapdrawing/" + this.props.currentGameId, + "http://172.20.2.143:5000/draw/mapdrawing/" + this.props.currentGameId, { method: "PUT", headers: { @@ -63,7 +63,7 @@ class UserMap extends Component { ); } else { fetch( - "http://localhost:5000/draw/mapdrawing/" + this.props.currentGameId, + "http://172.20.2.143: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://localhost:5000/draw/map/" + this.props.currentGameId, { + fetch("http://172.20.2.143:5000/draw/map/" + this.props.currentGameId, { method: "GET", headers: { Authorization: "Bearer " + sessionStorage.getItem("token"),