From 1599b61d22810e250f471b3b561660205297e07c Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 9 Jan 2023 21:03:50 +0100 Subject: thing --- src/main.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..5f49165 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,24 @@ +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 +} -- cgit v1.2.3-70-g09d2