use axum::{ extract::State, http::StatusCode, response::{Html, IntoResponse}, routing::get, Router, }; 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("

Copyright Wyatt J. Miller 2024

") } pub async fn not_found() -> impl IntoResponse { (StatusCode::NOT_FOUND, "¯\\_(ツ)_/¯") } async fn health() -> impl IntoResponse { StatusCode::OK } }