mz_environmentd/http/
root.rs1use askama::Template;
13use axum::response::IntoResponse;
14use mz_server_core::listeners::HttpRoutesEnabled;
15
16use crate::BUILD_INFO;
17
18#[derive(Template)]
19#[template(path = "home.html")]
20struct HomeTemplate<'a> {
21 version: &'a str,
22 build_sha: &'static str,
23 routes_enabled: HttpRoutesEnabled,
24}
25
26pub async fn handle_home(routes_enabled: HttpRoutesEnabled) -> impl IntoResponse {
27 mz_http_util::template_response(HomeTemplate {
28 version: BUILD_INFO.version,
29 build_sha: BUILD_INFO.sha,
30 routes_enabled,
31 })
32}
33
34mz_http_util::make_handle_static!(
35 dir_1: ::include_dir::include_dir!("$CARGO_MANIFEST_DIR/src/http/static"),
36 dir_2: ::include_dir::include_dir!("$OUT_DIR/src/http/static"),
37 prod_base_path: "src/http/static",
38 dev_base_path: "src/http/static-dev",
39);