added crates to public project, made api structure

This commit is contained in:
2024-09-22 22:38:35 -04:00
parent 3afff00b29
commit cf199ab48a
12 changed files with 2327 additions and 2 deletions

View File

@ -0,0 +1,2 @@
pub struct AuthorsRoute;
impl AuthorsRoute {}

View File

@ -0,0 +1,2 @@
pub struct CommentsRoute;
impl CommentsRoute {}

View File

@ -0,0 +1,4 @@
pub mod authors;
pub mod comments;
pub mod posts;
pub mod root;

View File

@ -0,0 +1,2 @@
pub struct PostsRoute;
impl PostsRoute {}

View File

@ -0,0 +1,15 @@
use axum::{
http::StatusCode,
response::{Html, IntoResponse},
};
pub struct RootRoute;
impl RootRoute {
pub async fn root() -> Html<&'static str> {
Html("<p>Copyright Wyatt J. Miller 2024</p>")
}
pub async fn not_found() -> impl IntoResponse {
(StatusCode::NOT_FOUND, "¯\\_(ツ)_/¯")
}
}