mirror of
https://gitee.com/johng/gf
synced 2026-07-05 21:32:17 +08:00
23 lines
393 B
Go
23 lines
393 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
)
|
|
|
|
func Order(r *ghttp.Request) {
|
|
r.Response.Write("GET")
|
|
}
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
s.Group("/api.v1", func(group *ghttp.RouterGroup) {
|
|
group.Hook("/*any", ghttp.HOOK_BEFORE_SERVE, func(r *ghttp.Request) {
|
|
r.Response.CORSDefault()
|
|
})
|
|
g.GET("/order", Order)
|
|
})
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|