mirror of
https://github.com/house-of-vanity/khm.git
synced 2025-08-21 22:27:14 +00:00
Added auto deprecation feature
This commit is contained in:
@@ -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",
|
||||
|
@@ -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");
|
||||
|
Reference in New Issue
Block a user