modify routes
This commit is contained in:
@@ -2,6 +2,7 @@ package services
|
||||
|
||||
import (
|
||||
"github.com/rogeecn/atom/container"
|
||||
"github.com/rogeecn/atom/contracts"
|
||||
"github.com/rogeecn/atom/providers/http"
|
||||
"go.uber.org/dig"
|
||||
)
|
||||
@@ -9,18 +10,15 @@ import (
|
||||
type Http struct {
|
||||
dig.In
|
||||
|
||||
Service http.Service
|
||||
Routes []http.Route `group:"routes"`
|
||||
Service http.Service
|
||||
Initials []contracts.Initial `group:"initials"`
|
||||
Routes []http.Route `group:"routes"`
|
||||
}
|
||||
|
||||
func ServeHttp() error {
|
||||
defer container.Close()
|
||||
|
||||
return container.Container.Invoke(func(http Http) error {
|
||||
for _, route := range http.Routes {
|
||||
route.Register()
|
||||
}
|
||||
|
||||
return http.Service.Serve()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user