1
0
mirror of https://github.com/actix/actix-website synced 2024-11-29 02:34:26 +01:00
actix-website/examples/application/src/vh.rs

21 lines
580 B
Rust
Raw Normal View History

2018-06-08 06:08:11 +02:00
#![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>