add apprise_ok
This commit is contained in:
parent
887adf5f2c
commit
9a7c24acbd
10
src/main.rs
10
src/main.rs
|
@ -2,7 +2,7 @@ use std::net::SocketAddr;
|
|||
use askama::Template;
|
||||
use axum::{
|
||||
extract::State,
|
||||
routing::post,
|
||||
routing::{get, post},
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Response},
|
||||
Json, Router,
|
||||
|
@ -67,6 +67,12 @@ async fn apprise_notification(
|
|||
.await
|
||||
}
|
||||
|
||||
async fn apprise_ok(
|
||||
) -> Response {
|
||||
([("content-type", "application/json")], "{}")
|
||||
.into_response()
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct Config {
|
||||
listen_port: u16,
|
||||
|
@ -91,7 +97,7 @@ async fn main() {
|
|||
// build our application with a route
|
||||
let app = Router::new()
|
||||
.route("/alert", post(prometheus_alerts))
|
||||
.route("/notify", post(apprise_notification))
|
||||
.route("/notify", get(apprise_ok).post(apprise_notification))
|
||||
.with_state(jabber);
|
||||
|
||||
let addr = SocketAddr::from(([127, 0, 0, 1], config.listen_port));
|
||||
|
|
Loading…
Reference in New Issue
Block a user