func main() { var server1 web.Server var server2 web.Server server1.Get("/(.*)", hello1) go server1.Run("0.0.0.0:9999") server2.Get("/(.*)", hello2) go server2.Run("0.0.0.0:8999") <-make(chan int) }
func StartServer(port int) (*web.Server, os.Error) { server := new(web.Server) wd, err := os.Getwd() if err != nil { return nil, err } server.Config = new(web.ServerConfig) server.Config.StaticDir = wd + "/web/" server.Post("/(.*)", pageRouter) server.Run("0.0.0.0:" + strconv.Itoa(port)) return server, nil }