pub fn create_app(app_state: AppState) -> App<AppState> {
    App::with_state(app_state)
        // enable logger
        .middleware(middleware::Logger::default())
        .resource("/status/{id}", |r| {
            r.method(http::Method::GET).with(gpio_status_route)
        })
        .resource("/set/level/{id}/{level}", |r| {
            r.method(http::Method::GET).with(set_gpio_level_route)
        })
}
/// creates and returns the app after mounting all routes/resources
creates and returns the app after mounting all routes/resources
creates and returns the app after mounting all routes / resources
pub fn create_app(app_state: AppState) -> App<AppState> {
    App::with_state(app_state)
        // enable logger
        .middleware(middleware::Logger::default())
        .resource("/status/{id}", |r| {
            r.method(http::Method::GET).with(gpio_status_route)
        })
        .resource("/set/level/{id}/{level}", |r| {
            r.method(http::Method::GET).with(set_gpio_level_route)
        })
}
pub fn create_app ( app_state : AppState ) -> App < AppState > { App :: with_state ( app_state ) // enable logger . middleware ( middleware :: Logger :: default ( ) ) . resource ( " " , | r | { r . method ( http :: Method :: GET ) . with ( gpio_status_route ) } ) . resource ( " " , | r | { r . method ( http :: Method :: GET ) . with ( set_gpio_level_route ) } ) }
creates and returns the app after mounting all routes/resources
creates and returns the app after mounting all routes / resources
app_state
AppState
app_state
AppState