mirror of
https://github.com/supleed2/nanobot.git
synced 2024-11-09 20:25:48 +00:00
Add /up
endpoint for uptime monitoring
This commit is contained in:
parent
125dca39b9
commit
1fc926a989
|
@ -115,7 +115,9 @@ async fn poise(
|
||||||
tracing::info!("Secrets loaded");
|
tracing::info!("Secrets loaded");
|
||||||
|
|
||||||
// Build Axum Router
|
// Build Axum Router
|
||||||
let router = axum::Router::new().route(
|
let router = axum::Router::new()
|
||||||
|
.route("/up", axum::routing::get(routes::up))
|
||||||
|
.route(
|
||||||
"/verify",
|
"/verify",
|
||||||
axum::routing::post({
|
axum::routing::post({
|
||||||
let pool = pool.clone();
|
let pool = pool.clone();
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
use crate::PendingMember;
|
use crate::PendingMember;
|
||||||
use axum::{http::StatusCode, response::IntoResponse, Json};
|
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 {
|
pub(crate) struct Verify {
|
||||||
id: String,
|
id: String,
|
||||||
shortcode: String,
|
shortcode: String,
|
||||||
|
|
Loading…
Reference in a new issue