diff options
author | stale <redkugelblitzin@gmail.com> | 2022-05-29 05:34:16 -0300 |
---|---|---|
committer | stale <redkugelblitzin@gmail.com> | 2022-05-29 05:34:16 -0300 |
commit | 8e8fb7c45e8088843b71cb55fede723b2f9c7ff2 (patch) | |
tree | a6fbcb4cb3ea575cac0dddb45d88ed103301dfbf /src/main.rs | |
parent | 2826d78bbfab50eab90e5a1611576f33e752b7d8 (diff) |
*really* basic public lobby
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 2b5f9b1..2f7d52c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,16 @@ async fn tokio_main(conf: Config) -> Result<(), Box<dyn Error>> { let style = path!("s.css").and(fs::file(conf.stylesheet.clone())); let code = path!("c.js").and(fs::file(conf.client_code.clone())); let font = path!("f.ttf").map(|| FONT_FILE); - let listing = path!("rlist").map(|| "placeholder'em"); + let listing = { + let pubs = public_rooms.clone(); + path!("rlist").and_then(move || { + let pubs = pubs.clone(); + async move { + Ok::<_,std::convert::Infallible>( + reply::json(&pubs.read().await.as_slice()) + ) + }}) + }; let rform_recv = { let rooms = rooms.clone(); let pubs = public_rooms.clone(); |