1
0
mirror of https://github.com/actix/actix-website synced 2025-03-15 20:53:07 +01:00

20 lines
390 B
Rust
Raw Normal View History

// <setup>
2020-01-02 12:56:32 +06:00
use actix_web::{web, App, Responder, HttpServer};
2019-12-29 01:15:22 +09:00
async fn index() -> impl Responder {
"Hello world!"
}
2019-12-29 01:15:22 +09:00
#[actix_rt::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().service(
web::scope("/app").route("/index.html", web::get().to(index)),
)
})
.bind("127.0.0.1:8088")?
.run()
.await
}
// </setup>