mod counter; mod counter_view; use counter::Counter; use counter_view::CounterView; use lunatic::supervisor::*; use submillisecond::{router, static_router, Application}; use submillisecond_live_view::prelude::*; struct Sup; impl Supervisor for Sup { type Arg = (); // Start 1 child and monitor it for failures. type Children = (Counter,); fn init(config: &mut SupervisorConfig, _: ()) { config.set_strategy(SupervisorStrategy::OneForOne); config.children_args(((0, Some(String::from("global_counter"))),)); } } fn main() -> std::io::Result<()> { let mut supconf = SupervisorConfig::default(); Sup::init(&mut supconf, ()); Application::new(router! { "/" => CounterView::handler("./static/index.html", "#app") "/static" => static_router!("./static") }) .serve("127.0.0.1:3000") }