Bachelorthesis_Code/frontend/src/App.js
cami 18e6420500 Updated some things in the frontend
- App zeigt nun eine Zeit an, wenn backend zur verfügung steht
- Docker-Port ist auf 3000, weil Standard
2021-05-07 04:00:13 +02:00

25 lines
615 B
JavaScript

import React, { useState, useEffect } from 'react';
import logo from './logo.svg';
import './App.css';
function App() {
const [currentTime, setCurrentTime] = useState(0);
useEffect(() => {
fetch('/time').then(res => res.json()).then(data => {
setCurrentTime(data.time);
});
}, []);
return (
<div className="App">
<header className="App-header">
<p>The current time is {currentTime}.</p>
</header>
</div>
);
}
export default App;