From 731404aea0fbffea377c0f09188b2cdc0b2c7247 Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Fri, 3 Jan 2020 15:04:25 +0100 Subject: [PATCH] Add state api --- src/api.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) }