Files
my-website-v2/backend/public/src/routes/root.rs

33 lines
707 B
Rust
Raw Normal View History

use axum::{
2025-06-29 23:41:20 -04:00
extract::State,
http::StatusCode,
response::{Html, IntoResponse},
routing::get,
Router,
};
2025-06-29 23:41:20 -04:00
use crate::{datasources::posts::PostsDatasource, state::AppState};
use super::posts::Post;
pub struct RootRoute;
impl RootRoute {
pub fn routes() -> Router {
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>")
}
pub async fn not_found() -> impl IntoResponse {
(StatusCode::NOT_FOUND, "¯\\_(ツ)_/¯")
}
async fn health() -> impl IntoResponse {
StatusCode::OK
}
}