Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit c7a35a4

Browse files
committed
fixed cors erros, due to missing protocol in url.
1 parent 3be0c5d commit c7a35a4

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

webapp_frontend/src/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import {
55
AxiosError,
66
} from "axios";
77

8-
const uri = "localhost:8080";
8+
const uri = "http://localhost:8080";
99

1010
interface BackendHealthData {
11-
time: number
11+
uptimeInSeconds: number
1212
}
1313

1414
function callBackendHealth():any{//BackendHealthData{
1515
return new Promise((resolve, reject) => {
16-
Axios.get("localhost:8080/health")//`${uri}/health`)
16+
Axios.get(`${uri}/health`)
1717
.then((data) => {
1818
resolve(data.data);
1919
})

webapp_frontend/src/components/App.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ function App() {
99
useEffect(() => {
1010
Promise.all([callBackendHealth()])
1111
.then(([backendHealthData]) => {
12-
setTest(backendHealthData)
13-
console.log(test)
12+
setTest(backendHealthData.uptimeInSeconds)
1413
})
1514
}, [test]);
1615

0 commit comments

Comments
 (0)