mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
README update
This commit is contained in:
@ -10,6 +10,8 @@ gf(Go Frame)是一款为Web服务及网络服务开发设计的,模块化、
|
||||
|
||||
gf是开源的,免费的,基于MIT协议进行分发,开源项目地址:https://gitee.com/johng/gf
|
||||
|
||||
欢迎加入技术交流QQ群:116707870
|
||||
|
||||
## 安装
|
||||
```
|
||||
go get -u gitee.com/johng/gf
|
||||
|
||||
17
geg/frame/mvc/controller/demo/router2.go
Normal file
17
geg/frame/mvc/controller/demo/router2.go
Normal file
@ -0,0 +1,17 @@
|
||||
package demo
|
||||
|
||||
import "gitee.com/johng/gf/g/net/ghttp"
|
||||
|
||||
func init() {
|
||||
ghttp.GetServer().BindHandler("/list", List)
|
||||
ghttp.GetServer().BindHandler("/list/page/2", List2)
|
||||
ghttp.GetServer().Router.SetRule(`\/list\/page\/(\d+)[\/\?]*`, "/list?page=$1&")
|
||||
}
|
||||
|
||||
func List1(r *ghttp.Request) {
|
||||
r.Response.WriteString("list page:" + r.GetQueryString("page"))
|
||||
}
|
||||
|
||||
func List2(r *ghttp.Request) {
|
||||
r.Response.WriteString("customed list page")
|
||||
}
|
||||
Reference in New Issue
Block a user