mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
28 lines
460 B
Go
28 lines
460 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/net/ghttp"
|
|
"github.com/gogf/gf/os/glog"
|
|
)
|
|
|
|
func main() {
|
|
s1 := ghttp.GetServer("s1")
|
|
s1.SetPort(8882)
|
|
s1.BindHandler("/", func(r *ghttp.Request) {
|
|
glog.Println("s1")
|
|
r.Response.Writeln("s1")
|
|
})
|
|
s1.Start()
|
|
|
|
s2 := ghttp.GetServer("s2")
|
|
s2.SetPort(8882)
|
|
s2.BindHandler("/", func(r *ghttp.Request) {
|
|
glog.Println("s2")
|
|
r.Response.Writeln("s2")
|
|
})
|
|
s2.Start()
|
|
|
|
g.Wait()
|
|
}
|