Files
gf/.example/net/ghttp/server/duplicate/duplicate3.go

26 lines
458 B
Go
Raw Normal View History

// 路由重复注册检查 - object
package main
import (
2019-07-29 21:01:19 +08:00
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
)
2019-04-03 00:03:46 +08:00
type Object struct{}
func (o *Object) Index(r *ghttp.Request) {
2019-04-03 00:03:46 +08:00
r.Response.Write("object index")
}
func (o *Object) Show(r *ghttp.Request) {
2019-04-03 00:03:46 +08:00
r.Response.Write("object show")
}
func main() {
2019-04-03 00:03:46 +08:00
s := g.Server()
g.Server().BindObject("/object", new(Object))
g.Server().BindObject("/object", new(Object))
s.SetPort(8199)
s.Run()
}