From 10dc386dd9cb24b259ee8e027b4d39ba40a8b92b Mon Sep 17 00:00:00 2001 From: ISA Date: Thu, 26 Sep 2024 12:12:14 +0200 Subject: [PATCH] Header und dashboard bekommen Daten --- components/Header.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Header.jsx b/components/Header.jsx index 8c8063a..257cb64 100644 --- a/components/Header.jsx +++ b/components/Header.jsx @@ -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) => {