Skip to content

Run the server

The REST API is a single native binary, CameraWebApp, that runs on the machine the camera is physically attached to. Everything else — the API reference, any client you generate — talks to it over HTTP.

Terminal window
CameraWebApp

The server listens on http://localhost:8080 and prints its startup banner. It handles SIGINT and SIGTERM, so Ctrl+C shuts it down cleanly — cameras are disconnected and open SSE streams closed before it exits.

Flag Default Description
--port, -p 8080 Port to listen on. Must be 1–65535.
Terminal window
CameraWebApp --port 9000

That is the complete set of flags. Anything else on the command line is ignored.

The server is an ordinary process, so any language that can spawn a subprocess can supervise it — start it, wait for /api/server/status to answer, and stop it on exit. See the server subprocess recipe for a worked example including port selection and readiness polling.

See the API reference for full request and response schemas.

GET /api/server/status returns server version, uptime, platform, and camera counts. Poll this to confirm the server is ready before issuing other calls.

Terminal window
curl http://localhost:8080/api/server/status

GET /api/server/logs returns buffered server log output. Query params: lines (default 100), level (default info).

Terminal window
curl http://localhost:8080/api/server/logs

POST /api/server/shutdown initiates graceful shutdown: disconnects all cameras, closes open SSE streams, then exits. Prefer this over sending a signal when shutting the server down from another process — it lets the camera disconnect cleanly.

Terminal window
curl -X POST http://localhost:8080/api/server/shutdown