support logger auto call
This commit is contained in:
@@ -14,18 +14,17 @@ import (
|
||||
type Http struct {
|
||||
dig.In
|
||||
|
||||
Logger *logger.Logger
|
||||
Conf *config.Config
|
||||
Service *http.Service
|
||||
Routes []contracts.Route `group:"route"`
|
||||
}
|
||||
|
||||
func Serve(http Http) error {
|
||||
http.Logger.Infof("http service port %s", http.Conf.Http.Address())
|
||||
logger.Infof("http service port %s", http.Conf.Http.Address())
|
||||
for _, route := range http.Routes {
|
||||
route.Register()
|
||||
}
|
||||
|
||||
http.Logger.Infof("starting server on %s", http.Conf.Http.Address())
|
||||
logger.Infof("starting server on %s", http.Conf.Http.Address())
|
||||
return http.Service.Serve()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user