Header und dashboard bekommen Daten
This commit is contained in:
@@ -4,12 +4,13 @@ import Image from "next/image";
|
||||
import "bootstrap-icons/font/bootstrap-icons.css";
|
||||
|
||||
function Header() {
|
||||
const apiUrl = process.env.NEXT_PUBLIC_API_BASE_URL;
|
||||
const [stationsname, setStationsname] = useState("Lädt..."); // Platzhalter
|
||||
const [cplStatus, setCplStatus] = useState("Lädt...");
|
||||
|
||||
useEffect(() => {
|
||||
// API-Aufruf, um die Daten vom Server zu holen
|
||||
fetch("http://localhost:3000/api/server?last20Messages.acp", {
|
||||
fetch(`${apiUrl}/CPL?last20Messages.acp`, {
|
||||
mode: "cors",
|
||||
})
|
||||
.then((response) => {
|
||||
|
||||
Reference in New Issue
Block a user