1
0
mirror of https://github.com/actix/actix-website synced 2025-02-13 00:25:35 +01:00

24 lines
544 B
Rust
Raw Normal View History

2020-01-02 12:56:32 +06:00
use actix_web::{web, App, HttpResponse, HttpServer};
2018-05-23 21:28:12 +02:00
pub mod app;
pub mod combine;
pub mod config;
pub mod scope;
pub mod state;
pub mod vh;
2018-05-23 22:01:33 +02:00
// <multi>
2020-09-12 16:21:54 +01:00
#[actix_web::main]
2020-01-02 12:56:32 +06:00
async fn main() -> std::io::Result<()> {
2020-01-02 12:43:41 +06:00
HttpServer::new(|| {
App::new()
2022-02-26 03:56:24 +00:00
.service(web::scope("/app1").route("/", web::to(HttpResponse::Ok)))
.service(web::scope("/app2").route("/", web::to(HttpResponse::Ok)))
.route("/", web::to(HttpResponse::Ok))
2020-01-02 12:43:41 +06:00
})
2022-02-26 03:56:24 +00:00
.bind(("127.0.0.1", 8080))?
2020-01-02 12:43:41 +06:00
.run()
.await
2018-05-23 21:28:12 +02:00
}
// </multi>