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.
Run it
Section titled “Run it”CameraWebAppThe 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.
Options
Section titled “Options”| Flag | Default | Description |
|---|---|---|
--port, -p |
8080 |
Port to listen on. Must be 1–65535. |
CameraWebApp --port 9000That is the complete set of flags. Anything else on the command line is ignored.
Running it from your own application
Section titled “Running it from your own application”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.
Health and control endpoints
Section titled “Health and control endpoints”See the API reference for full request and response schemas.
Server status
Section titled “Server status”GET /api/server/status returns server version, uptime, platform, and camera
counts. Poll this to confirm the server is ready before issuing other calls.
curl http://localhost:8080/api/server/status{ "success": true, "server": { "version": "3.0.0", "sdkVersion": "V2.01.00", "uptime": 42, "platform": "darwin-arm64" }, "cameras": { "connected": 1, "discovered": 2 }}Server logs
Section titled “Server logs”GET /api/server/logs returns buffered server log output. Query params: lines
(default 100), level (default info).
curl http://localhost:8080/api/server/logs{ "success": true, "logs": [ { "timestamp": "2026-03-02T12:18:45", "level": "info", "message": "GET /api/server/status" } ], "total": 47}Shutdown
Section titled “Shutdown”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.
curl -X POST http://localhost:8080/api/server/shutdown