mirror of
https://github.com/supleed2/nanobot.git
synced 2024-12-22 14:15:51 +00:00
Add /up
endpoint for uptime monitoring
This commit is contained in:
parent
125dca39b9
commit
1fc926a989
22
src/main.rs
22
src/main.rs
|
@ -115,16 +115,18 @@ async fn poise(
|
|||
tracing::info!("Secrets loaded");
|
||||
|
||||
// Build Axum Router
|
||||
let router = axum::Router::new().route(
|
||||
"/verify",
|
||||
axum::routing::post({
|
||||
let pool = pool.clone();
|
||||
let key = secret_store
|
||||
.get("VERIFY_KEY")
|
||||
.context("VERIFY_KEY not found")?;
|
||||
move |body| routes::verify(pool, body, key)
|
||||
}),
|
||||
);
|
||||
let router = axum::Router::new()
|
||||
.route("/up", axum::routing::get(routes::up))
|
||||
.route(
|
||||
"/verify",
|
||||
axum::routing::post({
|
||||
let pool = pool.clone();
|
||||
let key = secret_store
|
||||
.get("VERIFY_KEY")
|
||||
.context("VERIFY_KEY not found")?;
|
||||
move |body| routes::verify(pool, body, key)
|
||||
}),
|
||||
);
|
||||
|
||||
// Build Poise Instance
|
||||
let discord = poise::Framework::builder()
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
use crate::PendingMember;
|
||||
use axum::{http::StatusCode, response::IntoResponse, Json};
|
||||
|
||||
#[derive(serde::Deserialize, serde::Serialize)]
|
||||
#[tracing::instrument]
|
||||
pub(crate) async fn up() -> impl IntoResponse {
|
||||
(StatusCode::OK, "Nano is up!")
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub(crate) struct Verify {
|
||||
id: String,
|
||||
shortcode: String,
|
||||
|
|
Loading…
Reference in a new issue