mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-07 06:47:39 +03:00
use response instead of result for asyn c handlers
This commit is contained in:
parent
55698f2524
commit
53c5151692
5 changed files with 43 additions and 59 deletions
|
@ -8,9 +8,9 @@ fn index(req: HttpRequest, name: web::Path<String>) -> String {
|
|||
format!("Hello: {}!\r\n", name)
|
||||
}
|
||||
|
||||
async fn index_async(req: HttpRequest) -> Result<&'static str, Error> {
|
||||
async fn index_async(req: HttpRequest) -> &'static str {
|
||||
println!("REQ: {:?}", req);
|
||||
Ok("Hello world!\r\n")
|
||||
"Hello world!\r\n"
|
||||
}
|
||||
|
||||
#[get("/")]
|
||||
|
@ -26,7 +26,7 @@ fn main() -> std::io::Result<()> {
|
|||
App::new()
|
||||
.wrap(middleware::DefaultHeaders::new().header("X-Version", "0.2"))
|
||||
.wrap(middleware::Compress::default())
|
||||
// .wrap(middleware::Logger::default())
|
||||
.wrap(middleware::Logger::default())
|
||||
.service(index)
|
||||
.service(no_params)
|
||||
.service(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue