From 3aec5256ba8d0d3ce2d656401d92485d81ea1737 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Sat, 30 Sep 2023 14:57:56 -0700 Subject: [PATCH] add css and dist handling --- dist/app.css | 1 + src/main.rs | 2 ++ templates/base.rs.html | 2 ++ 3 files changed, 5 insertions(+) create mode 100644 dist/app.css diff --git a/dist/app.css b/dist/app.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/dist/app.css @@ -0,0 +1 @@ + diff --git a/src/main.rs b/src/main.rs index 1995812..2e593da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,6 +14,7 @@ use diesel_async::{ }; use dotenvy::dotenv; use std::net::SocketAddr; +use tower_http::services::ServeDir; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; include!(concat!(env!("OUT_DIR"), "/templates.rs")); @@ -61,6 +62,7 @@ async fn main() { .nest("/api", api::router()) .route("/", get(root)) .route("/shifts/:id/drinks", get(drinks)) + .fallback_service(ServeDir::new("./dist")) .with_state(state); // run our app with hyper diff --git a/templates/base.rs.html b/templates/base.rs.html index 0907820..b3e62d7 100644 --- a/templates/base.rs.html +++ b/templates/base.rs.html @@ -18,6 +18,8 @@ + +