add comments, serve static crap

This commit is contained in:
2024-03-23 16:19:00 -04:00
parent d22d3a71c8
commit f835c26f03
3 changed files with 40 additions and 1 deletions

View File

@@ -3,12 +3,14 @@ mod routes;
mod templates;
use actix_web::{web, App, HttpServer};
use actix_files as actix_fs;
pub(crate) async fn start_actix() -> anyhow::Result<()> {
log::info!("Serving an http server at http://0.0.0.0:8080");
HttpServer::new(|| {
App::new()
.route("/", web::get().to(routes::index))
.route("/", web::get().to(routes::index)) // index.html
.service(actix_fs::Files::new("/static", "./static").index_file("index.html")) // static directoryh
})
.bind("0.0.0.0:8080")?