381 Star 2.5K Fork 616

GVPJohn / gf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
status_map.go 416 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"gitee.com/johng/gf/g"
"gitee.com/johng/gf/g/net/ghttp"
)
func main() {
s := g.Server()
s.BindStatusHandlerByMap(map[int]ghttp.HandlerFunc {
403 : func(r *ghttp.Request){r.Response.Writeln("403")},
404 : func(r *ghttp.Request){r.Response.Writeln("404")},
500 : func(r *ghttp.Request){r.Response.Writeln("500")},
})
s.SetPort(8199)
s.Run()
}
Go
1
https://gitee.com/johng/gf.git
git@gitee.com:johng/gf.git
johng
gf
gf
v1.4.7

搜索帮助