Dashboard aktiv in navigtion beim ersten Aufruf

This commit is contained in:
ISA
2024-09-24 20:16:35 +02:00
parent 817495cd25
commit 8c05e61852
3 changed files with 129 additions and 14 deletions

View File

@@ -7,7 +7,10 @@ const DeviceData = () => {
useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch("/api/fetchDeviceData");
// Stelle sicher, dass die URL auf den richtigen Server zeigt (localhost:3000)
const response = await fetch(
"http://localhost:3000/api/fetchDeviceData"
);
if (!response.ok) {
throw new Error(`Fehler beim Abrufen der Daten: ${response.status}`);
}