1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 01:51:23 +02:00

add custom Debug impl for HttpResponse

This commit is contained in:
Nikolay Kim
2017-11-08 19:31:25 -08:00
parent 1392b2b171
commit 02fb424659
7 changed files with 41 additions and 13 deletions

View File

@ -13,12 +13,15 @@ use actix_web::*;
/// somple handle
fn index(req: &mut HttpRequest, _payload: Payload, state: &()) -> HttpResponse {
println!("{:?}", req);
httpcodes::HTTPOk.with_body("Welcome!")
httpcodes::HTTPOk
.builder()
.content_type("text/plain")
.body("Welcome!").unwrap()
}
fn main() {
if ::std::env::var("RUST_LOG").is_err() {
::std::env::set_var("RUST_LOG", "actix_web=info");
::std::env::set_var("RUST_LOG", "actix_web=trace");
}
let _ = env_logger::init();
let sys = actix::System::new("ws-example");