feat: comment routing

This commit is contained in:
Ahmet Kaan GÜMÜŞ 2024-12-15 20:56:24 +03:00
parent dc849dd970
commit 0d9cef79f3
4 changed files with 168 additions and 4 deletions

View file

@ -1,3 +1,4 @@
pub mod comment;
pub mod post;
pub mod role;
pub mod user;
@ -11,13 +12,21 @@ pub async fn route(State(app_state): State<AppState>) -> Router {
Router::new()
.route("/", get(alive))
.nest(
"/role",
"/roles",
role::route(axum::extract::State(app_state.clone())),
)
.nest(
"/user",
"/users",
user::route(axum::extract::State(app_state.clone())),
)
.nest(
"/posts",
post::route(axum::extract::State(app_state.clone())),
)
.nest(
"/comments",
comment::route(axum::extract::State(app_state.clone())),
)
.layer(CorsLayer::permissive())
.with_state(app_state)
}