MCPcopy Create free account
hub / github.com/kataras/iris / buildRouter

Method buildRouter

_examples/project/api/router.go:15–31  ·  view source on GitHub ↗

buildRouter is the most important part of your server. All root endpoints are registered here.

()

Source from the content-addressed store, hash-verified

13// buildRouter is the most important part of your server.
14// All root endpoints are registered here.
15func (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}

Callers 1

prepareMethod · 0.95

Calls 6

NewFunction · 0.92
AnyMethod · 0.65
PartyMethod · 0.65
RegisterDependencyMethod · 0.65
PartyConfigureMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected