Why is ApiRouter not just called Router? #176
-
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 |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
-
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:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
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
Router
s for the sensitive parts of your application and merge them with the rest.