2019-06-19 00:20:50 -04:00
|
|
|
// <setup>
|
2020-01-02 12:56:32 +06:00
|
|
|
use actix_web::{web, App, Responder, HttpServer};
|
2019-06-19 00:20:50 -04:00
|
|
|
|
2019-12-29 01:15:22 +09:00
|
|
|
async fn index() -> impl Responder {
|
2019-06-19 00:20:50 -04:00
|
|
|
"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
|
2019-06-19 00:20:50 -04:00
|
|
|
}
|
|
|
|
// </setup>
|