mirror of
https://gitee.com/johng/gf
synced 2026-07-06 13:42:46 +08:00
23 lines
391 B
Go
23 lines
391 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.HookBeforeServe, func(r *ghttp.Request) {
|
|
r.Response.CORSDefault()
|
|
})
|
|
g.GET("/order", Order)
|
|
})
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|