initial commit, simple http route

This commit is contained in:
2020-04-30 22:55:49 -04:00
commit 746701cfbf
4 changed files with 1501 additions and 0 deletions

14
src/main.rs Normal file
View File

@@ -0,0 +1,14 @@
use actix_web::{get, web, App, HttpServer, Responder};
#[get("/{id}/{name}/index.html")]
async fn index(info: web::Path<(u32, String)>) -> impl Responder {
format!("Hello {}! id:{}", info.1, info.0)
}
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| App::new().service(index))
.bind("0.0.0.0:8080")?
.run()
.await
}