mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-06 01:10:40 +00:00
refactor to use axum
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
mod routes;
|
||||
use crate::store;
|
||||
use axum::http::StatusCode;
|
||||
|
||||
pub use routes::*;
|
||||
pub async fn report_health() -> (StatusCode,) {
|
||||
if store::can_reach_redis() {
|
||||
return (StatusCode::OK,);
|
||||
} else {
|
||||
return (StatusCode::SERVICE_UNAVAILABLE,);
|
||||
}
|
||||
}
|
||||
|
@@ -1,16 +0,0 @@
|
||||
use actix_web::{get, web, HttpResponse, Responder, Scope};
|
||||
|
||||
use crate::store;
|
||||
|
||||
#[get("/")]
|
||||
async fn get_live() -> impl Responder {
|
||||
if store::can_reach_redis() {
|
||||
return HttpResponse::Ok();
|
||||
} else {
|
||||
return HttpResponse::ServiceUnavailable();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn init() -> Scope {
|
||||
web::scope("/live").service(get_live)
|
||||
}
|
Reference in New Issue
Block a user