Skip to content

ref: unify endpoints handling in the client#19

Open
krystofwoldrich wants to merge 4 commits into
EvanBacon:mainfrom
krystofwoldrich:@kw/preview-endpoint-manifest
Open

ref: unify endpoints handling in the client#19
krystofwoldrich wants to merge 4 commits into
EvanBacon:mainfrom
krystofwoldrich:@kw/preview-endpoint-manifest

Conversation

@krystofwoldrich

Copy link
Copy Markdown
Contributor

This refactors the preview config from a flat object into a small route manifest. The important change is that middleware routes and helper routes are now separate.

/api, /exec, /logs, and /appstate come from the host middleware under the configured preview base path.

/stream.mjpeg, /ws, and /config come from the per-device Swift helper on its own localhost port.

The new config shape is roughly:

{
  basePath: "/.sim",
  endpoints: {
    api: "/.sim/api",
    exec: "/.sim/exec",
    logs: "/.sim/logs?device=...",
    appState: "/.sim/appstate?device=..."
  },
  helper: {
    url: "http://127.0.0.1:3100",
    stream: "http://127.0.0.1:3100/stream.mjpeg",
    ws: "ws://127.0.0.1:3100/ws",
    config: "http://127.0.0.1:3100/config"
  }
}

This also injects the preview config even when no helper is running, so the empty state can still call middleware endpoints
like /exec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant