Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SimStadt
3DClient4SimStadtAPI
Commits
9b02ecb7
Commit
9b02ecb7
authored
Nov 24, 2021
by
Izairi
Browse files
add conaction Handling
parent
39b61e30
Changes
1
Show whitespace changes
Inline
Side-by-side
public/js/connectToAPI.js
View file @
9b02ecb7
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:808
2
/workflow/execute
"
// URL to API
var
url
=
"
http://vm24.fkc.hft-stuttgart.de:808
0
/workflow/execute
"
// URL to API
var
url2
=
"
http://vm24.fkc.hft-stuttgart.de:808
2
/workflow/timedShadowValueByDay/
"
var
url2
=
"
http://vm24.fkc.hft-stuttgart.de:808
3
/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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment