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