feat: ✨ comment routing
This commit is contained in:
parent
dc849dd970
commit
0d9cef79f3
4 changed files with 168 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue