Added auto deprecation feature

This commit is contained in:
Ultradesu
2025-07-20 17:37:46 +03:00
parent 9c5518b39e
commit af6c4d7e61
7 changed files with 58 additions and 3 deletions

View File

@@ -305,6 +305,7 @@ pub async fn run_server(args: crate::Args) -> std::io::Result<()> {
.app_data(web::Data::new(db_client.clone()))
.app_data(allowed_flows.clone())
// API routes
.route("/api/version", web::get().to(crate::web::get_version_api))
.route("/api/flows", web::get().to(crate::web::get_flows_api))
.route(
"/{flow_id}/scan-dns",

View File

@@ -67,6 +67,13 @@ async fn check_dns_resolution(hostname: String, semaphore: Arc<Semaphore>) -> Dn
}
}
// API endpoint to get application version
pub async fn get_version_api() -> Result<HttpResponse> {
Ok(HttpResponse::Ok().json(json!({
"version": env!("CARGO_PKG_VERSION")
})))
}
// API endpoint to get list of available flows
pub async fn get_flows_api(allowed_flows: web::Data<Vec<String>>) -> Result<HttpResponse> {
info!("API request for available flows");