pub fn run(config: Config) -> Result<(), Box<Error>> {
    env_logger::init().unwrap();

    // setup routing
    let mut router = Router::new();
    router.get("/", hello_world, "index");
    // take all requests
    fn hello_world(_: &mut Request) -> IronResult<Response> {
        debug!("GET hello-world");
        Ok(Response::with((status::Ok, "Hello World!")))
    }

    info!("Start the webserver...");
    debug!("{}", &config);
    let server = "localhost:".to_string() + &config.port.to_string();
    Iron::new(router).http(server).unwrap();

    Ok(())
}
/// Start the webserver. The method will not return normally while the server is running endlessly.
Start the webserver. The method will not return normally while the server is running endlessly.
Start the webserver . The method will not return normally while the server is running endlessly .
pub fn run(config: Config) -> Result<(), Box<Error>> {
    env_logger::init().unwrap();
    // setup routing
    let mut router = Router::new();
    router.get("/", hello_world, "index");
    // take all requests
    fn hello_world(_: &mut Request) -> IronResult<Response> {
        debug!("GET hello-world");
        Ok(Response::with((status::Ok, "Hello World!")))
    }
    info!("Start the webserver...");
    debug!("{}", &config);
    let server = "localhost:".to_string() + &config.port.to_string();
    Iron::new(router).http(server).unwrap();
    Ok(())
}
pub fn run ( config : Config ) -> Result < ( ) , Box < Error > > { env_logger :: init ( ) . unwrap ( ) ; // setup routing let mut router = Router :: new ( ) ; router . get ( " " , hello_world , " " ) ; // take all requests fn hello_world ( _ : & mut Request ) -> IronResult < Response > { debug ! ( " " ) ; Ok ( Response :: with ( ( status :: Ok , " " ) ) ) } info ! ( " " ) ; debug ! ( " " config ) ; let server = " " . to_string ( ) + & config . port . to_string ( ) ; Iron :: new ( router ) . http ( server ) . unwrap ( ) ; Ok ( ( ) ) }
Start the webserver.
Start the webserver .
config
Config
config
Config