pub fn run_http_server(sender: Sender<Message>) -> io::Result<()> {
    info!("Starting HTTP server on {}...", SERVER_ADDRESS);

    HttpServer::new(move || {
        let scope_low = web::scope("/low")
            .route("/led/{id}", web::put().to(put_led))
            .route("/led", web::get().to(get_leds))
            .route("/motor/power/ratio", web::post().to(post_motor_power_ratio));

        App::new()
            .wrap(Logger::default())
            .data(sender.clone())
            .service(scope_low)
            .default_service(web::route().to(default_handler))
    })
    .keep_alive(120)
    .bind(SERVER_ADDRESS)
    .unwrap()
    .run()
}
/// Start HTTP API server in blocking mode.
///
/// # Arguments
///
/// * `sender` - A channel for communication with Arduino via serial port.
Start HTTP API server in blocking mode.
Start HTTP API server in blocking mode .
pub fn run_http_server(sender: Sender<Message>) -> io::Result<()> {
    info!("Starting HTTP server on {}...", SERVER_ADDRESS);
    HttpServer::new(move || {
        let scope_low = web::scope("/low")
            .route("/led/{id}", web::put().to(put_led))
            .route("/led", web::get().to(get_leds))
            .route("/motor/power/ratio", web::post().to(post_motor_power_ratio));
        App::new()
            .wrap(Logger::default())
            .data(sender.clone())
            .service(scope_low)
            .default_service(web::route().to(default_handler))
    })
    .keep_alive(120)
    .bind(SERVER_ADDRESS)
    .unwrap()
    .run()
}
pub fn run_http_server ( sender : Sender < Message > ) -> io :: Result < ( ) > { info ! ( " " SERVER_ADDRESS ) ; HttpServer :: new ( move | | { let scope_low = web :: scope ( " " ) . route ( " " , web :: put ( ) . to ( put_led ) ) . route ( " " , web :: get ( ) . to ( get_leds ) ) . route ( " " , web :: post ( ) . to ( post_motor_power_ratio ) ) ; App :: new ( ) . wrap ( Logger :: default ( ) ) . data ( sender . clone ( ) ) . service ( scope_low ) . default_service ( web :: route ( ) . to ( default_handler ) ) } ) . keep_alive ( 120 ) . bind ( SERVER_ADDRESS ) . unwrap ( ) . run ( ) }
Start HTTP API server in blocking mode.
Start HTTP API server in blocking mode .
sender
Sender<Message>
sender
Sender<Message>