0 Star 0 Fork 620

李明 / gf

forked from John / gf 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
domain.go 400 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import "gitee.com/johng/gf/g/net/ghttp"
func Hello1(r *ghttp.Request) {
r.Response.Write("127.0.0.1: Hello World1!")
}
func Hello2(r *ghttp.Request) {
r.Response.Write("localhost: Hello World2!")
}
func main() {
s := ghttp.GetServer()
s.Domain("127.0.0.1").BindHandler("/", Hello1)
s.Domain("localhost").BindHandler("/", Hello2)
s.SetPort(8199)
s.Run()
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/limingsky/gf.git
git@gitee.com:limingsky/gf.git
limingsky
gf
gf
c9a36a8224f1

搜索帮助

344bd9b3 5694891 D2dac590 5694891