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.
This commit is contained in:
Richard Bowman 2026-03-31 22:21:27 +01:00 committed by Julian Stirling
parent acdc88e870
commit 9851485057
4 changed files with 5 additions and 2 deletions

View file

@ -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/"

View file

@ -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/"

View file

@ -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/"

View file

@ -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",