irahardianto / service-pattern-go

Simple clean Go REST API architecture with dependency injection and mocking example, following SOLID principles.
https://irahardianto.github.io/service-pattern-go/
854 stars 123 forks source link

Adding more routes & organizing routes #2

Closed demamoh closed 6 years ago

demamoh commented 6 years ago

First of all great repository, very "clean" architecture.

One of the questions I have is about adding more routes. Currently all your routes are in router.InitRouter. How would you manage having more routes like close to 50? Would you still keep everything in InitRouter?

The other question I have is about organizing routes. Would you organize your controller methods together in a set function? Also, how would you?

irahardianto commented 6 years ago

Hi, I am sorry for the very late reply, I'll pay more attention for notification in the future.

Yes that is the idea, they will be listed down in the InitRouter. As for controller function separation, it is already neatly contained in each service container inject function. if you have any advice I welcome PR & advice to make the repo better.

demamoh commented 6 years ago

No problem. Thanks.