You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
493 B

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. package cmd
  2. import (
  3. "context"
  4. "github.com/gogf/gf/v2/frame/g"
  5. "github.com/gogf/gf/v2/net/ghttp"
  6. "github.com/gogf/gf/v2/os/gcmd"
  7. )
  8. var (
  9. Main = gcmd.Command{
  10. Name: "main",
  11. Usage: "main",
  12. Brief: "start http server",
  13. Func: func(ctx context.Context, parser *gcmd.Parser) (err error) {
  14. s := g.Server()
  15. s.Group("/", func(group *ghttp.RouterGroup) {
  16. group.Middleware(ghttp.MiddlewareHandlerResponse)
  17. group.Bind(
  18. )
  19. })
  20. s.Run()
  21. return nil
  22. },
  23. }
  24. )