From 98514850577df4a5c2ee3ea59c3a3eea26718226 Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Tue, 31 Mar 2026 22:21:27 +0100 Subject: [PATCH] Update config and lifecycle test to use API prefix This adds an API prefix to the three config files, and updates the hard-coded URLs in the lifecycle test to use the new API root. The change doesn't affect the unit or integration test suites, as neither of these set an API prefix. Most of the required updates are likely to be in the web app, which I've not yet touched. --- ofm_config_full.json | 1 + ofm_config_manual.json | 1 + ofm_config_simulation.json | 1 + tests/lifecycle_test/testfile.py | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ofm_config_full.json b/ofm_config_full.json index 16a211fb..53ca2587 100644 --- a/ofm_config_full.json +++ b/ofm_config_full.json @@ -26,6 +26,7 @@ "bg_channel_deviations_luv": "openflexure_microscope_server.things.background_detect:ChannelDeviationLUV" }, "settings_folder": "/var/openflexure/settings/", + "api_prefix": "/api/v3", "application_config": { "log_folder": "/var/openflexure/logs/", "data_folder": "/var/openflexure/data/" diff --git a/ofm_config_manual.json b/ofm_config_manual.json index 4498cf81..e9b0c092 100644 --- a/ofm_config_manual.json +++ b/ofm_config_manual.json @@ -4,6 +4,7 @@ "system": "openflexure_microscope_server.things.system:OpenFlexureSystem" }, "settings_folder": "./openflexure/settings/", + "api_prefix": "/api/v3", "application_config": { "log_folder": "./openflexure/logs/", "data_folder": "./openflexure/data/" diff --git a/ofm_config_simulation.json b/ofm_config_simulation.json index b52ce4d7..076d7243 100644 --- a/ofm_config_simulation.json +++ b/ofm_config_simulation.json @@ -20,6 +20,7 @@ "bg_channel_deviations_luv": "openflexure_microscope_server.things.background_detect:ChannelDeviationLUV" }, "settings_folder": "./openflexure/settings/", + "api_prefix": "/api/v3", "application_config": { "log_folder": "./openflexure/logs/", "data_folder": "./openflexure/data/" diff --git a/tests/lifecycle_test/testfile.py b/tests/lifecycle_test/testfile.py index 2278c6e2..48b41f69 100755 --- a/tests/lifecycle_test/testfile.py +++ b/tests/lifecycle_test/testfile.py @@ -74,7 +74,7 @@ def main() -> None: def test_client_connection() -> None: """Check a ThingClient can interact with the simulation microscope camera.""" print("Connecting Python client to microscope, and capturing image") - cam_client = lt.ThingClient.from_url("http://localhost:5000/camera/") + cam_client = lt.ThingClient.from_url("http://localhost:5000/api/v3/camera/") img = Image.open(cam_client.grab_jpeg().open()) print(f"Successfully grabbed image of size {img.size}") assert img.size == (820, 616) @@ -95,7 +95,7 @@ def subscribe_to_mjpeg_stream() -> subprocess.Popen: "nohup", "curl", "-s", - "http://localhost:5000/camera/mjpeg_stream", + "http://localhost:5000/api/v3/camera/mjpeg_stream", ">", "/dev/null", "2>&1",