added health, fallback not found endpoints
This commit is contained in:
@ -8,15 +8,20 @@ use axum::{
|
||||
pub struct RootRoute;
|
||||
impl RootRoute {
|
||||
pub fn routes() -> Router {
|
||||
Router::new().route("/", get(RootRoute::root))
|
||||
// .fallback(RootRoute::not_found)
|
||||
Router::new()
|
||||
.route("/", get(RootRoute::root))
|
||||
.route("/health", get(RootRoute::health))
|
||||
}
|
||||
|
||||
async fn root() -> Html<&'static str> {
|
||||
Html("<p>Copyright Wyatt J. Miller 2024</p>")
|
||||
}
|
||||
|
||||
async fn not_found() -> impl IntoResponse {
|
||||
pub async fn not_found() -> impl IntoResponse {
|
||||
(StatusCode::NOT_FOUND, "¯\\_(ツ)_/¯")
|
||||
}
|
||||
|
||||
async fn health() -> impl IntoResponse {
|
||||
StatusCode::OK
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user