Compare commits
2 commits
28fb489dac
...
66eff8f7ba
Author | SHA1 | Date | |
---|---|---|---|
66eff8f7ba | |||
501b185437 |
3 changed files with 2 additions and 1 deletions
|
@ -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
BIN
web/uppe.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Loading…
Reference in a new issue