use crate::frontend::style::CSS_BUNDLE; use actix_web::{get, web, App, HttpServer, Responder}; use frontend::pages::home::page_home; pub mod frontend; #[get("/assets/style.css")] async fn assets_style() -> impl Responder { CSS_BUNDLE } #[get("/{name}")] async fn hello(name: web::Path) -> impl Responder { format!("Hello {}!", &name) } #[actix_web::main] async fn main() -> std::io::Result<()> { env_logger::init_from_env("LOG"); HttpServer::new(|| App::new().service(page_home).service(hello)) .bind(("127.0.0.1", 8080))? .run() .await }