Rearrangement

This commit is contained in:
SinTan1729
2023-04-02 16:53:55 -05:00
parent d9f7e9537d
commit 0e97516759
15 changed files with 1275 additions and 98 deletions

19
actix/src/main.rs Normal file
View File

@@ -0,0 +1,19 @@
use actix_files::Files;
use actix_web::{get, web, App, HttpServer, Responder};
#[get("/hello/{name}")]
async fn greet(name: web::Path<String>) -> impl Responder {
format!("Hello {name}!")
}
#[actix_web::main] // or #[tokio::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.service(greet)
.service(Files::new("/", "./resources/").index_file("index.html"))
})
.bind(("127.0.0.1", 2000))?
.run()
.await
}