diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-09 21:03:50 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-09 21:03:50 +0100 |
commit | 1599b61d22810e250f471b3b561660205297e07c (patch) | |
tree | 74df4a9c5a5780e8f5203af4414e29b388cbea12 /src/main.rs | |
download | jellything-1599b61d22810e250f471b3b561660205297e07c.tar jellything-1599b61d22810e250f471b3b561660205297e07c.tar.bz2 jellything-1599b61d22810e250f471b3b561660205297e07c.tar.zst |
thing
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 24 |
1 files changed, 24 insertions, 0 deletions
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<String>) -> 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 +} |