mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 01:51:23 +02:00
add status code helper method for http response
This commit is contained in:
@ -33,8 +33,8 @@ and returns a `HttpResponse` instance or actor that uses `HttpContext` as an act
|
||||
extern crate actix_web;
|
||||
use actix_web::prelude::*;
|
||||
|
||||
fn index(req: HttpRequest) -> Result<HttpResponse> {
|
||||
Ok(httpcodes::HTTPOk.with_body("Hello world!"))
|
||||
fn index(req: HttpRequest) -> &'static str {
|
||||
"Hello world!"
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user