fix urls
This commit is contained in:
parent
779379f32d
commit
e8cac82b4f
|
@ -32,7 +32,7 @@ async fn main() {
|
||||||
// build our application with some routes
|
// build our application with some routes
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.nest_service("/static", ServeDir::new("static"))
|
.nest_service("/static", ServeDir::new("static"))
|
||||||
.route("/greet/:name", get(greet))
|
.route("/", get(register_form))
|
||||||
.route("/register/", post(register))
|
.route("/register/", post(register))
|
||||||
.with_state(db_pool);
|
.with_state(db_pool);
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ async fn main() {
|
||||||
.unwrap();
|
.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 };
|
let template = HelloTemplate { name };
|
||||||
HtmlTemplate(template)
|
HtmlTemplate(template)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue