Why is ApiRouter not just called Router? #176
Answered
by
tamasfe
justinclitheroe
asked this question in
Q&A
|
Hey Y'all, currently adding aide in to a fairly large codebase and was wondering why the wrapper class aide::axum::ApiRouter isn't just Router in the same way that get/post/etc are just drop in replacements? Figure there's a reason I was just wondering what it was |
Answered by
tamasfe
Jan 16, 2025
Replies: 2 comments
|
The intent was to make it harder to accidentally expose parts of the API in documentation that you do not intend. The distinct router types help making sure that leakages don't happen, you can create regular |
0 replies
Answer selected by
tamasfe
|
Oh cool.
Thanks for the explainer
…On Thu, Jan 16, 2025, 2:52 PM Ferenc Tamás ***@***.***> wrote:
The intent was to make it harder to accidentally expose parts of the API
in documentation that you do not intend. route() and api_route() already
do this, however they both accept the same arguments and it is easy to
accidentally call one over the other.
The distinct router types help making sure that leakages don't happen, you
can create regular Routers for the sensitive parts of your application
and merge them with the rest.
—
Reply to this email directly, view it on GitHub
<#176 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC3TWZXCZ2MSY6CRM6JMCBD2LALXVAVCNFSM6AAAAABVKM2LGSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBVHE2DSNI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The intent was to make it harder to accidentally expose parts of the API in documentation that you do not intend.
route()andapi_route()already do this, however they both accept the same arguments and it is easy to accidentally call one over the other.The distinct router types help making sure that leakages don't happen, you can create regular
Routers for the sensitive parts of your application and merge them with the rest.