static_assets.rs (815B)
1 use axum::{ 2 http::{StatusCode, header}, 3 response::{Html, IntoResponse}, 4 }; 5 6 use super::INDEX_HTML; 7 8 pub(super) async fn index() -> Html<&'static str> { 9 Html(INDEX_HTML) 10 } 11 12 pub(super) async fn favicon() -> impl IntoResponse { 13 ( 14 StatusCode::NO_CONTENT, 15 [(header::CACHE_CONTROL, "public, max-age=86400")], 16 ) 17 } 18 19 pub(super) async fn alpine_js() -> impl IntoResponse { 20 ( 21 [( 22 header::CONTENT_TYPE, 23 "application/javascript; charset=utf-8", 24 )], 25 include_str!("../../../www/assets/alpine.min.js"), 26 ) 27 } 28 29 pub(super) async fn app_js() -> impl IntoResponse { 30 ( 31 [( 32 header::CONTENT_TYPE, 33 "application/javascript; charset=utf-8", 34 )], 35 include_str!("../../../www/assets/iuna-ui.js"), 36 ) 37 }