use axum::{ http::header, response::{Html, IntoResponse}, routing::get, Router, }; use crate::state::AppState; pub fn routes() -> Router { Router::new() .route("/", get(web_ui)) .route("/wasm/warzone_wasm.js", get(wasm_js)) .route("/wasm/warzone_wasm_bg.wasm", get(wasm_binary)) } async fn web_ui() -> Html<&'static str> { Html(WEB_HTML) } async fn wasm_js() -> impl IntoResponse { ( [(header::CONTENT_TYPE, "application/javascript")], include_str!("../../../../wasm-pkg/warzone_wasm.js"), ) } async fn wasm_binary() -> impl IntoResponse { ( [(header::CONTENT_TYPE, "application/wasm")], include_bytes!("../../../../wasm-pkg/warzone_wasm_bg.wasm").as_slice(), ) } const WEB_HTML: &str = r##" Warzone

WARZONE

end-to-end encrypted messenger
"##;