20 lines
445 B
Rust
20 lines
445 B
Rust
use actix_files as fs;
|
|
use actix_web::{get, web, App, HttpServer, Responder};
|
|
|
|
#[get("/yeet")]
|
|
async fn yeet() -> impl Responder {
|
|
println!("yeet!");
|
|
format!("yeet!")
|
|
}
|
|
|
|
#[actix_rt::main]
|
|
async fn main() -> std::io::Result<()> {
|
|
HttpServer::new(|| {
|
|
App::new()
|
|
.service(yeet)
|
|
.service(fs::Files::new("/", "static/").index_file("index.html"))
|
|
})
|
|
.bind("127.0.0.1:8080")?
|
|
.run()
|
|
.await
|
|
} |