We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
能否添加命名路由的支持,第二个参数作为路由的名称,类似这样:
Router::new() .path("writers") .get(list_writers, "list_writers") .post(create_writer, "create_writer") .push( Router::with_path("<id>") .get(show_writer, "show_writer") .patch(edit_writer, "edit_writer") .delete(delete_writer, "delete_writer") .push(Router::with_path("articles").get(list_writer_articles)), );
然后再添加个函数route,通过名称获取路径,类似:
Router::route("list_writers") 返回 /writers Router::route("create_writer") 返回 /writers Router::route("show_writer", 1) 返回 /writers/1
Router::route("list_writers")
/writers
Router::route("create_writer")
Router::route("show_writer", 1)
/writers/1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
能否添加命名路由的支持,第二个参数作为路由的名称,类似这样:
然后再添加个函数route,通过名称获取路径,类似:
Router::route("list_writers")
返回/writers
Router::route("create_writer")
返回/writers
Router::route("show_writer", 1)
返回/writers/1
The text was updated successfully, but these errors were encountered: