mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 06:39:22 +02:00
better handler result handling
This commit is contained in:
@ -78,10 +78,10 @@ fn main() {
|
||||
.resource("/", |r| r.handler(Method::GET, |req| {
|
||||
println!("{:?}", req);
|
||||
|
||||
Ok(httpcodes::HTTPFound
|
||||
.build()
|
||||
.header("LOCATION", "/index.html")
|
||||
.body(Body::Empty)?)
|
||||
httpcodes::HTTPFound
|
||||
.build()
|
||||
.header("LOCATION", "/index.html")
|
||||
.body(Body::Empty)
|
||||
}))
|
||||
// static files
|
||||
.route_handler("/static", StaticFiles::new("examples/static/", true)))
|
||||
|
Reference in New Issue
Block a user