add css and dist handling

This commit is contained in:
Zynh0722 2023-09-30 14:57:56 -07:00
parent 20b214e262
commit 3aec5256ba
3 changed files with 5 additions and 0 deletions

1
dist/app.css vendored Normal file
View file

@ -0,0 +1 @@

View file

@ -14,6 +14,7 @@ use diesel_async::{
}; };
use dotenvy::dotenv; use dotenvy::dotenv;
use std::net::SocketAddr; use std::net::SocketAddr;
use tower_http::services::ServeDir;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
include!(concat!(env!("OUT_DIR"), "/templates.rs")); include!(concat!(env!("OUT_DIR"), "/templates.rs"));
@ -61,6 +62,7 @@ async fn main() {
.nest("/api", api::router()) .nest("/api", api::router())
.route("/", get(root)) .route("/", get(root))
.route("/shifts/:id/drinks", get(drinks)) .route("/shifts/:id/drinks", get(drinks))
.fallback_service(ServeDir::new("./dist"))
.with_state(state); .with_state(state);
// run our app with hyper // run our app with hyper

View file

@ -18,6 +18,8 @@
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">
<!-- <link rel="icon" href="/icon.svg" type="image/svg+xml"> --> <!-- <link rel="icon" href="/icon.svg" type="image/svg+xml"> -->
<link rel="stylesheet" href="/app.css" />
<script src="https://unpkg.com/htmx.org@@1.9.5"></script> <script src="https://unpkg.com/htmx.org@@1.9.5"></script>
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script> <script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>