mirror of
https://github.com/actix/actix-website
synced 2024-11-29 02:34:26 +01:00
21 lines
580 B
Rust
21 lines
580 B
Rust
|
#![allow(unused)]
|
||
|
use actix_web::{http::Method, server, App, HttpRequest, HttpResponse, Responder};
|
||
|
|
||
|
// <vh>
|
||
|
fn main() {
|
||
|
let server = server::new(|| {
|
||
|
vec![
|
||
|
App::new()
|
||
|
.filter(pred::Host("www.rust-lang.org"))
|
||
|
.resource("/", |r| r.f(|r| HttpResponse::Ok())),
|
||
|
App::new()
|
||
|
.filter(pred::Host("users.rust-lang.org"))
|
||
|
.resource("/", |r| r.f(|r| HttpResponse::Ok())),
|
||
|
App::new().resource("/", |r| r.f(|r| HttpResponse::Ok())),
|
||
|
]
|
||
|
});
|
||
|
|
||
|
server.run();
|
||
|
}
|
||
|
// </vh>
|