1
0
mirror of https://github.com/actix/actix-website synced 2024-12-03 20:22:13 +01:00
actix-website/examples/application/src/main.rs

29 lines
602 B
Rust
Raw Normal View History

use actix_web::{web, App, HttpResponse};
2018-05-23 21:28:12 +02:00
pub mod app;
pub mod combine;
pub mod config;
2020-01-02 07:43:41 +01:00
pub mod config_app;
pub mod scope;
pub mod state;
pub mod vh;
2018-05-23 22:01:33 +02:00
// <multi>
2020-01-02 07:43:41 +01:00
#[actix_rt::main]
async fn main() {
HttpServer::new(|| {
App::new()
.service(
web::scope("/app1").route("/", web::to(|| HttpResponse::Ok())),
)
.service(
web::scope("/app2").route("/", web::to(|| HttpResponse::Ok())),
)
.route("/", web::to(|| HttpResponse::Ok()))
})
.bind("127.0.0.1:8088")?
.run()
.await
2018-05-23 21:28:12 +02:00
}
// </multi>