Пример #1
0
func main() {
	svc := service.API(configure())

	svc.Chain(exampleMiddleware)

	healthcheck.Register(svc.Router(), "/healthcheck", func() bool {
		return true
	})

	svc.Router().Path("/").Methods("GET").HandlerFunc(exampleHandler)

	svc.Start()
}
Пример #2
0
func main() {
	cfg := configure()
	svc := service.Web(cfg)

	render.Render = render.New(cfg)
	session.Init(cfg)
	static.Register(cfg, svc.Router())

	svc.Chain(render.WithCsrfHandler)
	svc.Chain(exampleMiddleware)

	healthcheck.Register(svc.Router(), "/healthcheck", func() bool {
		return true
	})

	svc.Router().Path("/").Methods("GET").HandlerFunc(exampleHandler)

	svc.Start()
}