web_ui 0.1.1

A simple Rust library for creating local web interfaces with real-time communication
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use web_ui::{WebUI, WebUIConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = WebUIConfig::default()
        .with_static_dir("./static/hello".to_string());
    let web_ui = WebUI::new(config);
    
    // Simple button click handler
    web_ui.bind_click("hello-btn", || {
        println!("Hello, World!");
    }).await;
    
    println!("Starting simple web UI on http://localhost:3030");
    web_ui.run().await
}