@@ -10,6 +10,7 @@ import (
1010 "github.com/afteracademy/goserve-example-api-server-postgres/api/blog/editor"
1111 "github.com/afteracademy/goserve-example-api-server-postgres/api/blogs"
1212 "github.com/afteracademy/goserve-example-api-server-postgres/api/contact"
13+ "github.com/afteracademy/goserve-example-api-server-postgres/api/health"
1314 "github.com/afteracademy/goserve-example-api-server-postgres/api/user"
1415 "github.com/afteracademy/goserve-example-api-server-postgres/config"
1516 coreMW "github.com/afteracademy/goserve/v2/middleware"
@@ -21,13 +22,14 @@ import (
2122type Module network.Module [module ]
2223
2324type module struct {
24- Context context.Context
25- Env * config.Env
26- DB postgres.Database
27- Store redis.Store
28- UserService user.Service
29- AuthService auth.Service
30- BlogService blog.Service
25+ Context context.Context
26+ Env * config.Env
27+ DB postgres.Database
28+ Store redis.Store
29+ UserService user.Service
30+ AuthService auth.Service
31+ BlogService blog.Service
32+ HealthService health.Service
3133}
3234
3335func (m * module ) GetInstance () * module {
@@ -36,6 +38,7 @@ func (m *module) GetInstance() *module {
3638
3739func (m * module ) Controllers () []network.Controller {
3840 return []network.Controller {
41+ health .NewController (m .HealthService ),
3942 auth .NewController (m .AuthenticationProvider (), m .AuthorizationProvider (), m .AuthService ),
4043 user .NewController (m .AuthenticationProvider (), m .AuthorizationProvider (), m .UserService ),
4144 blog .NewController (m .AuthenticationProvider (), m .AuthorizationProvider (), m .BlogService ),
@@ -66,14 +69,16 @@ func NewModule(context context.Context, env *config.Env, db postgres.Database, s
6669 userService := user .NewService (db )
6770 authService := auth .NewService (db , env , userService )
6871 blogService := blog .NewService (db , store , userService )
72+ healthService := health .NewService ()
6973
7074 return & module {
71- Context : context ,
72- Env : env ,
73- DB : db ,
74- Store : store ,
75- UserService : userService ,
76- AuthService : authService ,
77- BlogService : blogService ,
75+ Context : context ,
76+ Env : env ,
77+ DB : db ,
78+ Store : store ,
79+ UserService : userService ,
80+ AuthService : authService ,
81+ BlogService : blogService ,
82+ HealthService : healthService ,
7883 }
7984}
0 commit comments