This commit is contained in:
Franz Dietrich 2023-06-15 10:09:33 +02:00
parent 779379f32d
commit e8cac82b4f
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ async fn main() {
// build our application with some routes
let app = Router::new()
.nest_service("/static", ServeDir::new("static"))
.route("/greet/:name", get(greet))
.route("/", get(register_form))
.route("/register/", post(register))
.with_state(db_pool);
@ -45,7 +45,7 @@ async fn main() {
.unwrap();
}
async fn greet(extract::Path(name): extract::Path<String>) -> impl IntoResponse {
async fn register_form(extract::Path(name): extract::Path<String>) -> impl IntoResponse {
let template = HelloTemplate { name };
HtmlTemplate(template)
}