Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Main = gcmd.Command{ Name: "main", Usage: "main", Brief: "start http server", Func: func(ctx context.Context, parser *gcmd.Parser) (err error) { s := g.Server() if gfile.Exists("./static/public/html/") { s.SetIndexFolder(true) s.SetServerRoot("./static/public/html/") } else { g.Log().Error(ctx, "./static/public/html/ directory is not exist") } s.Group("/", func(group *ghttp.RouterGroup) { group.Middleware( ghttp.MiddlewareHandlerResponse, middleware.GlobalExceptionMiddleware, ) group.Group("/api", func(group *ghttp.RouterGroup) { group.Bind( controller.Hello, controller.Authentication, controller.Target, controller.AlertWebhook, ) }) group.Group("/api", func(group *ghttp.RouterGroup) { group.Middleware( middleware.TokenMiddleware, ) group.Bind( controller.Group, controller.Node, controller.User, controller.Rules, controller.Config, controller.Alert, ) }) }) s.Run() return nil }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.