1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 18:37:05 +00:00

add one more project structure recommendation

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-11-19 14:13:42 +02:00
parent d62392bebc
commit 226a4cb064
15 changed files with 1166 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
package api
import (
"github.com/username/project/api/users"
"github.com/username/project/user"
"github.com/kataras/iris/v12"
)
// buildRouter is the most important part of your server.
// All root endpoints are registered here.
func (srv *Server) buildRouter() {
// Add a simple health route.
srv.Any("/health", func(ctx iris.Context) {
ctx.Writef("%s\n\nOK", srv.String())
})
api := srv.Party("/api")
api.RegisterDependency(user.NewRepository)
api.PartyConfigure("/user", new(users.API))
}