Commit 9b02ecb7 authored by Izairi's avatar Izairi
Browse files

add conaction Handling

parent 39b61e30
var coordinatesBB = [] var coordinatesBB = []
//var url = "https://simstadt-api.iaf-ex.hft-stuttgart.de:8080/workflow/execute" //old link //var url = "https://simstadt-api.iaf-ex.hft-stuttgart.de:8080/workflow/execute" //old link
var url = "http://vm24.fkc.hft-stuttgart.de:8082/workflow/execute" // URL to API var url = "http://vm24.fkc.hft-stuttgart.de:8080/workflow/execute" // URL to API
var url2 = "http://vm24.fkc.hft-stuttgart.de:8082/workflow/timedShadowValueByDay/" var url2 = "http://vm24.fkc.hft-stuttgart.de:8083/workflow/timedShadowValueByDay/"
/*TODO#1: -get current data from the api and create local test data (apiData foler) /*TODO#1: -get current data from the api and create local test data (apiData foler)
-add connection handeling (error messages when there isnt a connection and then using the local test data) -add connection handeling (error messages when there isnt a connection and then using the local test data)
*/ */
...@@ -38,6 +38,10 @@ async function fetchshadowDataJSON() { ...@@ -38,6 +38,10 @@ async function fetchshadowDataJSON() {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": "Basic YWRtaW46YWRtaW4xMjM=" "Authorization": "Basic YWRtaW46YWRtaW4xMjM="
} }
}).then(function() {
console.log("ok");
}).catch(function() {
alert("Connetion error to server, use local data")
}) })
const data = await response.json() const data = await response.json()
return data return data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment