[][src]Function feattle_ui::run_warp_server

pub async fn run_warp_server<F, P>(
    admin_panel: Arc<AdminPanel<F, P>>,
    addr: impl Into<SocketAddr> + 'static
) where
    F: Feattles<P> + Sync + Send + 'static,
    P: Persist + Sync + Send + 'static, 

Run the given admin panel using warp framework.

To use it, make sure to activate the cargo feature "warp" in your Cargo.toml.

Example

use feattle_ui::{AdminPanel, run_warp_server};
use feattle_core::{feattles, Feattles};
use feattle_core::persist::NoPersistence;
use std::sync::Arc;

feattles! {
    struct MyToggles { a: bool, b: i32 }
}

// `NoPersistence` here is just a mock for the sake of the example
let my_toggles = Arc::new(MyToggles::new(NoPersistence));
let admin_panel = Arc::new(AdminPanel::new(my_toggles, "Project Panda - DEV".to_owned()));

run_warp_server(admin_panel, ([127, 0, 0, 1], 3030)).await;