Lack of Support for Grouping of Routes #100
-
Summary:The current version of gofr lacks support for grouping routes, which is a fundamental feature for organizing and managing complex web applications efficiently. Description:In many modern web applications, the number of routes can grow significantly, leading to a potential lack of organization and readability in the codebase. Grouping routes provides a clean and structured way to manage related routes under a common namespace, enhancing code maintainability and developer experience. Expected Behavior:I expect gofr to incorporate a feature that allows developers to group routes, similar to how other popular frameworks/libraries (e.g., gin, echo) provide this functionality. This feature should permit developers to organize routes logically, making the codebase more modular and easier to navigate. Use Case:Consider the scenario where an application has multiple API endpoints related to user authentication, each requiring different levels of access. With route grouping, developers could define a "auth" group and nest routes for login, registration, and user profile under this namespace. This would result in cleaner and more maintainable code, as well as improved readability. Additional Questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
GoFr is primarily for microservices, and complex logic of an application is already broken down into different small microservices. For something like an |
Beta Was this translation helpful? Give feedback.
GoFr is primarily for microservices, and complex logic of an application is already broken down into different small microservices.
Microservices are divided based on different functionalities, which reduces the complexity of having all the routes at one place and need to group them.
For something like an
auth
group we can exempt routes from the auth middleware itself.