mirror of
https://github.com/actix/actix-website
synced 2024-11-28 18:32:39 +01:00
23 lines
661 B
Rust
23 lines
661 B
Rust
#![allow(unused)]
|
|
use actix_web::{guard, web, App, HttpRequest, HttpResponse, HttpServer, Responder};
|
|
|
|
// <vh>
|
|
fn main() {
|
|
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();
|
|
}
|
|
// </vh>
|