buildRouter is the most important part of your server. All root endpoints are registered here.
()
| 13 | // buildRouter is the most important part of your server. |
| 14 | // All root endpoints are registered here. |
| 15 | func (srv *Server) buildRouter() { |
| 16 | // Add a simple health route. |
| 17 | srv.Any("/health", modrevision.New(modrevision.Options{ |
| 18 | ServerName: srv.config.ServerName, |
| 19 | Env: srv.config.Env, |
| 20 | Developer: "kataras", |
| 21 | TimeLocation: time.FixedZone("Greece/Athens", 7200), |
| 22 | })) |
| 23 | |
| 24 | api := srv.Party("/api") |
| 25 | api.RegisterDependency( |
| 26 | database.Open(srv.config.ConnString), |
| 27 | user.NewRepository, |
| 28 | ) |
| 29 | |
| 30 | api.PartyConfigure("/user", new(users.API)) |
| 31 | } |
no test coverage detected