use axum::http::{StatusCode, header};
use axum::response::{IntoResponse, Response};
const STYLE_CSS: &[u8] = include_bytes!("../../assets/style.css");
const HTMX_JS: &[u8] = include_bytes!("../../assets/htmx.min.js");
fn serve(bytes: &'static [u8], content_type: &'static str) -> Response {
(
StatusCode::OK,
[
(header::CONTENT_TYPE, content_type),
(header::CACHE_CONTROL, "public, max-age=3600"),
],
bytes,
)
.into_response()
}
pub(crate) async fn style_css() -> Response {
serve(STYLE_CSS, "text/css; charset=utf-8")
}
pub(crate) async fn htmx_js() -> Response {
serve(HTMX_JS, "application/javascript; charset=utf-8")
}