mirror of
https://github.com/actix/actix-website
synced 2024-11-30 19:14:36 +01:00
28 lines
618 B
Rust
28 lines
618 B
Rust
use actix_web::{web, App, HttpResponse, HttpServer};
|
|
|
|
pub mod app;
|
|
pub mod combine;
|
|
pub mod config;
|
|
pub mod scope;
|
|
pub mod state;
|
|
pub mod vh;
|
|
|
|
// <multi>
|
|
#[actix_web::main]
|
|
async fn main() -> std::io::Result<()> {
|
|
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:8080")?
|
|
.run()
|
|
.await
|
|
}
|
|
// </multi>
|