got nested routing working

This commit is contained in:
2024-12-10 03:04:55 -08:00
parent 5e04815911
commit 6ce6b9289a
10 changed files with 328 additions and 19 deletions

View File

@@ -1,3 +1,13 @@
use crate::state::AppState;
pub(super) use super::*;
pub mod signup;
pub const AUTH_TAG: &str = "auth";
pub fn router(state: AppState) -> OpenApiRouter {
OpenApiRouter::new()
.routes(routes!(signup::signup))
.with_state(state)
}

View File

@@ -1,7 +1,11 @@
use axum::{extract::State, response::Response};
use crate::state::AppState;
use super::*;
// /// Get customer
// ///
// /// Just return a static Customer object
// #[utoipa::path(get, path = "", responses((status = OK, body = Customer)), tag = super::CUSTOMER_TAG)]
// pub async fn signup() -> Json<Customer> {}
/// Sign up
#[utoipa::path(get, path = "/signup", responses((status = OK, body = String)), tag = super::AUTH_TAG)]
pub async fn signup(State(state): State<AppState>) -> Response<String> {
Response::new("Hello, World!".to_string())
}