diff --git a/src/api.js b/src/api.js index 7dbf980..c7a2d44 100644 --- a/src/api.js +++ b/src/api.js @@ -1,7 +1,11 @@ import Axios from 'axios' +const BACKEND_HOST = 'http://169.254.61.222:5000' + export function getMap(x, y) { - return Axios.get(`http://169.254.61.222:5000/generate/${x}/${y}`).then( - data => data.data - ) + return Axios.get(`${BACKEND_HOST}/generate/${x}/${y}`).then(data => data.data) +} + +export function getState() { + return Axios.get(`${BACKEND_HOST}/state`).then(data => data.data) }