From 96242fa6b0903caff87e29b2392f9092c0a44de8 Mon Sep 17 00:00:00 2001
From: Pim Hutting
Date: Mon, 12 Jan 2026 15:17:38 +0100
Subject: [PATCH] chore: fix connection error
was connected to wrong endpoint after merge
ref: N25B-400
---
src/pages/MonitoringPage/MonitoringPageAPI.ts | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/pages/MonitoringPage/MonitoringPageAPI.ts b/src/pages/MonitoringPage/MonitoringPageAPI.ts
index 5476a8c..076d6fa 100644
--- a/src/pages/MonitoringPage/MonitoringPageAPI.ts
+++ b/src/pages/MonitoringPage/MonitoringPageAPI.ts
@@ -1,5 +1,6 @@
import { useEffect } from 'react';
-const API_BASE = "http://localhost:8000/button_pressed"; // Change depending on Pims interup agent/ correct endpoint
+const API_BASE_BP = "http://localhost:8000/button_pressed"; // Change depending on Pims interup agent/ correct endpoint
+const API_BASE = "http://localhost:8000";
/**
@@ -8,7 +9,7 @@ const API_BASE = "http://localhost:8000/button_pressed"; // Change depending on
*/
const sendAPICall = async (type: string, context: string, endpoint?: string) => {
try {
- const response = await fetch(`${API_BASE}${endpoint ?? ""}`, {
+ const response = await fetch(`${API_BASE_BP}${endpoint ?? ""}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ type, context }),
@@ -71,7 +72,7 @@ export async function playExperiment(): Promise {
*/
export function useExperimentLogger(onUpdate?: (data: any) => void) {
useEffect(() => {
- const eventSource = new EventSource(`${API_BASE}`);
+ const eventSource = new EventSource(`${API_BASE}/experiment_stream`);
eventSource.onmessage = (event) => {
try {