mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-11-16 08:30:43 +08:00
Several commands had no route or returned stubs, so e2e tests silently got null or empty data. A missing route now fails loudly, the profile loads on first use so onboarding works, and node status is polled over HTTP. A parity test keeps the routes from drifting from the Tauri handlers again; it also caught revisions_by_patch being registered twice.
23 lines
593 B
Rust
23 lines
593 B
Rust
use std::net::SocketAddr;
|
|
|
|
use tokio::net::TcpListener;
|
|
|
|
mod api;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub struct Options {
|
|
pub listen: SocketAddr,
|
|
}
|
|
|
|
pub async fn run(options: Options) -> anyhow::Result<()> {
|
|
let listener = TcpListener::bind(options.listen).await?;
|
|
// Read by the e2e harness to learn the port when it asked for port 0.
|
|
println!("listening on {}", listener.local_addr()?);
|
|
let app =
|
|
api::router(api::Shared::default()).into_make_service_with_connect_info::<SocketAddr>();
|
|
|
|
axum::serve(listener, app)
|
|
.await
|
|
.map_err(anyhow::Error::from)
|
|
}
|