diff options
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(); |