    let _addr = server::new(|| {
        App::with_state(AppState {
            foo: "bar".to_string(),
        }).middleware(middleware::Logger::default())
            .resource("/", |r| {
                r.method(http::Method::GET).with(index);
            })
            .resource("/post1", |r| {
                r.method(http::Method::POST).with(handle_post_1)
            })
            .resource("/post2", |r| {
                r.method(http::Method::POST).with(handle_post_2)
            })