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.

32 lines
654 B

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