2019-06-19 00:20:50 -04:00
|
|
|
pub mod cfg;
|
|
|
|
pub mod dhandler;
|
2019-06-25 18:20:36 -04:00
|
|
|
pub mod guard;
|
|
|
|
pub mod guard2;
|
2019-06-19 00:20:50 -04:00
|
|
|
pub mod minfo;
|
|
|
|
pub mod norm;
|
|
|
|
pub mod norm2;
|
|
|
|
pub mod path;
|
|
|
|
pub mod path2;
|
|
|
|
pub mod resource;
|
|
|
|
pub mod scope;
|
|
|
|
pub mod url_ext;
|
|
|
|
pub mod urls;
|
2018-05-24 10:13:55 -07:00
|
|
|
|
|
|
|
// <main>
|
2019-06-25 18:20:36 -04:00
|
|
|
use actix_web::{web, App, HttpResponse, HttpServer};
|
2018-05-24 10:13:55 -07:00
|
|
|
|
2019-12-29 04:10:02 +09:00
|
|
|
async fn index() -> HttpResponse {
|
2019-06-25 18:20:36 -04:00
|
|
|
HttpResponse::Ok().body("Hello")
|
2018-05-24 10:13:55 -07:00
|
|
|
}
|
|
|
|
|
2020-09-12 16:21:54 +01:00
|
|
|
#[actix_web::main]
|
2019-12-29 04:10:02 +09:00
|
|
|
async fn main() -> std::io::Result<()> {
|
2019-06-25 18:20:36 -04:00
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new()
|
|
|
|
.route("/", web::get().to(index))
|
|
|
|
.route("/user", web::post().to(index))
|
|
|
|
})
|
2022-02-26 03:56:24 +00:00
|
|
|
.bind(("127.0.0.1", 8080))?
|
2019-06-25 18:20:36 -04:00
|
|
|
.run()
|
2019-12-29 04:10:02 +09:00
|
|
|
.await
|
2018-05-24 10:13:55 -07:00
|
|
|
}
|
|
|
|
// </main>
|