feat: The Big One UI #47
@@ -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<void> {
|
||||
*/
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user