Encapsulate everything that is needed to pass information from handler to service layer. The first one may look like this, but can be expanded to fit our needs.
type AppContext struct {
DB *db.MongoDB
Input interface{}
}
Also add a new handler that can take care of the plumbing/common code in all handlers.
Encapsulate everything that is needed to pass information from handler to service layer. The first one may look like this, but can be expanded to fit our needs.
Also add a new handler that can take care of the plumbing/common code in all handlers.