musikbot2/src/main.rs
Kai Vogelgesang 3a581b17d4 Init
2020-02-16 20:58:08 +01:00

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
}