mirror of
https://gitee.com/johng/gf.git
synced 2024-12-01 11:48:09 +08:00
19 lines
342 B
Go
19 lines
342 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
)
|
|
|
|
func main() {
|
|
s := g.Server()
|
|
s.BindHandler("/", func(r *ghttp.Request) {
|
|
r.Response.Writeln("halo 世界!")
|
|
})
|
|
s.BindStatusHandler(404, func(r *ghttp.Request) {
|
|
r.Response.Writeln("This is customized 404 page")
|
|
})
|
|
s.SetPort(8199)
|
|
s.Run()
|
|
}
|