diff options
Diffstat (limited to 'crates/whirl_api/src')
| -rw-r--r-- | crates/whirl_api/src/lib.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/whirl_api/src/lib.rs b/crates/whirl_api/src/lib.rs index 3ab6cd8..d2f7811 100644 --- a/crates/whirl_api/src/lib.rs +++ b/crates/whirl_api/src/lib.rs @@ -47,3 +47,18 @@ impl Api { sys.block_on(server) } } + +pub fn make() -> tokio::task::JoinHandle<()> { + // actix_web::rt::System::new("").block_on(rx.recv().unwrap().stop(true)); + + tokio::spawn(async move { + let _ = crate::Api::listen( + std::sync::mpsc::channel().0, + &*format!( + "0.0.0.0:{}", + whirl_config::Config::get().whirlsplash.api.port + ), + ) + .await; + }) +} |