gf/.example/net/ghttp/server/server2.go

22 lines
341 B
Go
Raw Normal View History

2017-12-31 18:18:00 +08:00
package main
import (
2019-07-29 21:01:19 +08:00
"github.com/gogf/gf/net/ghttp"
2017-12-31 18:18:00 +08:00
)
func main() {
2019-04-03 00:03:46 +08:00
s1 := ghttp.GetServer("s1")
s1.SetAddr(":8080")
s1.SetIndexFolder(true)
s1.SetServerRoot("/home/www/static1")
go s1.Run()
2017-12-31 18:18:00 +08:00
2019-04-03 00:03:46 +08:00
s2 := ghttp.GetServer("s2")
s2.SetAddr(":8081")
s2.SetIndexFolder(true)
s2.SetServerRoot("/home/www/static2")
go s2.Run()
2017-12-31 18:18:00 +08:00
2019-04-03 00:03:46 +08:00
select {}
2017-12-31 18:18:00 +08:00
}