mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 05:07:44 +08:00
18 lines
387 B
Go
18 lines
387 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/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()
|
|
}
|