2024-09-22 21:38:35 -05:00
|
|
|
use axum::{
|
|
|
|
http::StatusCode,
|
|
|
|
response::{Html, IntoResponse},
|
2024-09-24 19:26:15 -05:00
|
|
|
routing::get,
|
|
|
|
Router,
|
2024-09-22 21:38:35 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
pub struct RootRoute;
|
|
|
|
impl RootRoute {
|
2024-09-24 19:26:15 -05:00
|
|
|
pub fn routes() -> Router {
|
2024-09-25 17:29:12 -05:00
|
|
|
Router::new().route("/", get(RootRoute::root))
|
|
|
|
// .fallback(RootRoute::not_found)
|
2024-09-24 19:26:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
async fn root() -> Html<&'static str> {
|
2024-09-22 21:38:35 -05:00
|
|
|
Html("<p>Copyright Wyatt J. Miller 2024</p>")
|
|
|
|
}
|
|
|
|
|
2024-09-24 19:26:15 -05:00
|
|
|
async fn not_found() -> impl IntoResponse {
|
2024-09-22 21:38:35 -05:00
|
|
|
(StatusCode::NOT_FOUND, "¯\\_(ツ)_/¯")
|
|
|
|
}
|
|
|
|
}
|