mirror of
https://gitee.com/johng/gf
synced 2026-07-07 06:15:15 +08:00
19 lines
370 B
Go
19 lines
370 B
Go
package main
|
|
|
|
import "gitee.com/johng/gf/g/net/ghttp"
|
|
|
|
func Hello1(r *ghttp.Request) {
|
|
r.Response.WriteString("Hello World1!")
|
|
}
|
|
|
|
func Hello2(r *ghttp.Request) {
|
|
r.Response.WriteString("Hello World2!")
|
|
}
|
|
|
|
func main() {
|
|
s := ghttp.GetServer()
|
|
s.Domain("127.0.0.1").BindHandler("/", Hello1)
|
|
s.Domain("localhost").BindHandler("/", Hello2)
|
|
s.Run()
|
|
}
|