example compose.yaml, includestr styles, ignore default bind mount

This commit is contained in:
2026-04-04 21:42:08 +02:00
parent 252f7b164b
commit f49fb9df6f
4 changed files with 30 additions and 2 deletions

View File

@@ -1,16 +1,22 @@
use axum::{
Router,
http::header,
response::{IntoResponse, Redirect, Response},
routing::get,
};
use tower_http::services::ServeFile;
mod components;
mod icons;
mod pages;
pub const STYLES_CSS: &str = include_str!("./styles.css");
pub fn web_router() -> Router {
Router::new()
.route_service("/styles.css", ServeFile::new("src/web/styles.css"))
.route(
"/styles.css",
get(|| async { ([(header::CONTENT_TYPE, "text/css")], STYLES_CSS) }),
)
.merge(pages::pages())
}