Compare commits

...

2 commits

Author SHA1 Message Date
66eff8f7ba
feat: favicon!! 2024-12-03 02:43:01 +01:00
501b185437
chore: moved web stuff in its own dir 2024-12-03 02:42:56 +01:00
3 changed files with 2 additions and 1 deletions

View file

@ -6,12 +6,13 @@ use crate::{db::Database, Config};
pub async fn serve(config: Config, db: Database, addr: &str) -> std::io::Result<()>{ pub async fn serve(config: Config, db: Database, addr: &str) -> std::io::Result<()>{
// whats a jinja // whats a jinja
let index = include_str!("../index.html") let index = include_str!("../web/index.html")
.replacen("%%DESCRIPTION%%", config.description.as_deref().unwrap_or("keeping track of your infra's up status"), 1) .replacen("%%DESCRIPTION%%", config.description.as_deref().unwrap_or("keeping track of your infra's up status"), 1)
.replacen("%%THRESHOLD%%", &config.threshold.unwrap_or(1000).to_string(), 1); .replacen("%%THRESHOLD%%", &config.threshold.unwrap_or(1000).to_string(), 1);
let app = axum::Router::new() let app = axum::Router::new()
.route("/", axum::routing::get(|| async { Html(index) })) .route("/", axum::routing::get(|| async { Html(index) }))
.route("/favicon.ico", axum::routing::get(|| async { include_bytes!("../web/uppe.ico") }))
.route("/api/status", axum::routing::get(api_status)) .route("/api/status", axum::routing::get(api_status))
.route("/api/status/:service", axum::routing::get(api_status_service)) .route("/api/status/:service", axum::routing::get(api_status_service))
.with_state(db); .with_state(db);

BIN
web/uppe.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB