mirror of
https://github.com/actix/actix-website
synced 2024-12-02 19:52:23 +01:00
17 lines
368 B
Rust
17 lines
368 B
Rust
|
// <resource>
|
||
|
use actix_web::{http::Method, App, HttpRequest, HttpResponse};
|
||
|
|
||
|
fn index(req: HttpRequest) -> HttpResponse {
|
||
|
unimplemented!()
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
App::new()
|
||
|
.resource("/prefix", |r| r.f(index))
|
||
|
.resource("/user/{name}", |r| {
|
||
|
r.method(Method::GET).f(|req| HttpResponse::Ok())
|
||
|
})
|
||
|
.finish();
|
||
|
}
|
||
|
// </resource>
|