-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
I am have this endpoint a post request which does not respond even the the print statement i have in the function
It this even the way a post request fn is created
async fn create_user(
StateRef(state): StateRef<'_, AppState>,
ExtensionRef(user_data): ExtensionRef<'_, CreateUserRequest>,
) -> String {
println!("Testing Create User API");
let id = state
.user_db
.next_id
.fetch_add(1, std::sync::atomic::Ordering::SeqCst)
.to_string();
let _new_user = User {
id,
name: user_data.name.clone(),
email: user_data.email.clone(),
created_at: chrono::Local::now().to_rfc3339(),
};
}
below is the routes of said request
let app = App::new()
.with_state(state)
.at("/test-post", post(handler_service(async || "POST works\n")))
.at("/users/create", post(handler_service(create_user)));
the test-post works though
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels