Skip to content

Instantly share code, notes, and snippets.

@diegoholiveira
Created April 28, 2020 22:10
Show Gist options
  • Save diegoholiveira/6ccba5856c527bd8d8371a4533526d1b to your computer and use it in GitHub Desktop.
Save diegoholiveira/6ccba5856c527bd8d8371a4533526d1b to your computer and use it in GitHub Desktop.
package purchaseshistory
import (
"github.com/go-chi/chi"
"go.uber.org/fx"
)
var Module = fx.Options(
fx.Invoke(registerEndpoints),
factories,
)
var factories = fx.Provide(
NewPurchasesHistoryHandler,
NewPurchasesRepository,
)
func registerEndpoints(router chi.Router, handler PurchasesHistoryHandler) {
router.Method("GET", "/users/{id}/purchases", handler)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment