Files
radicle-explorer/crates/test-http-api/src/main.rs
T
Rūdolfs Ošiņš b0a519d1c5 Mirror every Tauri command in test-http-api
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.
2026-10-01 18:16:29 +02:00

36 lines
806 B
Rust

use std::process;
use test_http_api as api;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let options = parse_options()?;
match api::run(options).await {
Ok(()) => {}
Err(_) => {
process::exit(1);
}
}
Ok(())
}
fn parse_options() -> Result<api::Options, lexopt::Error> {
use lexopt::prelude::*;
let mut parser = lexopt::Parser::from_env();
let mut listen = None;
while let Some(arg) = parser.next()? {
match arg {
Long("listen") => {
let addr = parser.value()?.parse()?;
listen = Some(addr);
}
_ => return Err(arg.unexpected()),
}
}
Ok(api::Options {
listen: listen.unwrap_or_else(|| ([127, 0, 0, 1], 8081).into()),
})
}