2018-06-07 21:08:11 -07:00
|
|
|
#![allow(unused)]
|
2019-06-13 03:24:25 -04:00
|
|
|
use actix_web::{guard, web, App, HttpRequest, HttpResponse, HttpServer, Responder};
|
2018-06-07 21:08:11 -07:00
|
|
|
|
|
|
|
// <vh>
|
|
|
|
fn main() {
|
2019-06-13 03:24:25 -04:00
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new()
|
|
|
|
.service(
|
|
|
|
web::scope("/")
|
|
|
|
.guard(guard::Header("Host", "www.rust-lang.org"))
|
|
|
|
.route("", web::to(|| HttpResponse::Ok())),
|
|
|
|
)
|
|
|
|
.service(
|
|
|
|
web::scope("/")
|
|
|
|
.guard(guard::Header("Host", "users.rust-lang.org"))
|
|
|
|
.route("", web::to(|| HttpResponse::Ok())),
|
|
|
|
)
|
|
|
|
.route("/", web::to(|| HttpResponse::Ok()))
|
|
|
|
})
|
|
|
|
.run();
|
2018-06-07 21:08:11 -07:00
|
|
|
}
|
|
|
|
// </vh>
|