github.com/gogf/gf@v1.16.9/.example/net/ghttp/server/hooks/cors1.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/gogf/gf/frame/g"
     5  	"github.com/gogf/gf/net/ghttp"
     6  )
     7  
     8  func Order(r *ghttp.Request) {
     9  	r.Response.Write("GET")
    10  }
    11  
    12  func main() {
    13  	s := g.Server()
    14  	s.Group("/api.v1", func(group *ghttp.RouterGroup) {
    15  		g.GET("/order", Order)
    16  	})
    17  	s.SetPort(8199)
    18  	s.Run()
    19  }