Skip to content

Why is ApiRouter not just called Router? #176

Answered by tamasfe
justinclitheroe asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tamasfe
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants