From fe116a8117bf398a83bb25efbd5c866fc33c3d4f Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 19 Sep 2022 17:31:57 +0300 Subject: Small optimizations to frontend code There is a possibility of refactoring some of the companion code to act as a generic embedded asset framework and put it in the `util` crate. --- kittybox-rs/src/frontend/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'kittybox-rs/src/frontend') diff --git a/kittybox-rs/src/frontend/mod.rs b/kittybox-rs/src/frontend/mod.rs index 0797ba6..e2187c9 100644 --- a/kittybox-rs/src/frontend/mod.rs +++ b/kittybox-rs/src/frontend/mod.rs @@ -267,13 +267,14 @@ pub async fn catchall( } } -static STYLE_CSS: &[u8] = include_bytes!("./style.css"); -static ONBOARDING_JS: &[u8] = include_bytes!("./onboarding.js"); -static ONBOARDING_CSS: &[u8] = include_bytes!("./onboarding.css"); +const STYLE_CSS: &[u8] = include_bytes!("./style.css"); +const ONBOARDING_JS: &[u8] = include_bytes!("./onboarding.js"); +const ONBOARDING_CSS: &[u8] = include_bytes!("./onboarding.css"); +const INDIEAUTH_JS: &[u8] = include_bytes!("./indieauth.js"); -static MIME_JS: &str = "application/javascript"; -static MIME_CSS: &str = "text/css"; -static MIME_PLAIN: &str = "text/plain"; +const MIME_JS: &str = "application/javascript"; +const MIME_CSS: &str = "text/css"; +const MIME_PLAIN: &str = "text/plain"; pub async fn statics(Path(name): Path) -> impl IntoResponse { use axum::http::header::CONTENT_TYPE; -- cgit 1.4.1