axum-folder-router/examples/advanced/api/users/[id]/route.rs

5 lines
147 B
Rust

use axum::{extract::Path, response::IntoResponse};
pub async fn get(Path(id): Path<String>) -> impl IntoResponse {
format!("User ID: {id}")
}