|
@@ -1,5 +1,8 @@
|
|
|
+const serverUrl = "http://192.168.8.101:5000"
|
|
|
+//const serverUrl = "http://localhost:5000"
|
|
|
+
|
|
|
export const fetchPathKeys = () => {
|
|
|
- return fetch("http://localhost:5000/get-path")
|
|
|
+ return fetch(serverUrl + "/get-path")
|
|
|
.then(res => {
|
|
|
if(res.status >= 400) {
|
|
|
throw new Error("Server responds with error!");
|
|
@@ -14,7 +17,7 @@ export const fetchPathKeys = () => {
|
|
|
|
|
|
|
|
|
export const fetchPaths = () => {
|
|
|
- return fetch("http://localhost:5000/get-path")
|
|
|
+ return fetch(serverUrl + "/get-path")
|
|
|
.then(res => {
|
|
|
if(res.status >= 400) {
|
|
|
throw new Error("Server responds with error!");
|
|
@@ -48,7 +51,7 @@ export function savePathToDb(){
|
|
|
body: json
|
|
|
}
|
|
|
|
|
|
- return fetch("http://localhost:5000/set-path", reqOptions)
|
|
|
+ return fetch(serverUrl + "/set-path", reqOptions)
|
|
|
.then(res => {
|
|
|
if(res.status >= 400) {
|
|
|
throw new Error("Server responds with error!");
|
|
@@ -71,7 +74,7 @@ export function saveTimeToDb(data){
|
|
|
body: json
|
|
|
}
|
|
|
|
|
|
- return fetch("http://localhost:5000/set-time", reqOptions)
|
|
|
+ return fetch(serverUrl + "/set-time", reqOptions)
|
|
|
.then(res => {
|
|
|
if(res.status >= 400) {
|
|
|
console.log(res.text)
|