Skip to content

Commit

Permalink
Merge pull request #1839 from pweil-/multiport-hello-openshift
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Apr 22, 2015
2 parents 6335763 + 7719a17 commit 4f3e65a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions examples/hello-openshift/hello_openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,21 @@ func helloHandler(w http.ResponseWriter, r *http.Request) {
func main() {
http.HandleFunc("/", helloHandler)

fmt.Println("Started, serving at 8080")
err := http.ListenAndServe(":8080", nil)
if err != nil {
panic("ListenAndServe: " + err.Error())
}
go func() {
fmt.Println("serving on 8080")
err := http.ListenAndServe(":8080", nil)
if err != nil {
panic("ListenAndServe: " + err.Error())
}
}()


go func() {
fmt.Println("serving on 8888")
err := http.ListenAndServe(":8888", nil)
if err != nil {
panic("ListenAndServe: " + err.Error())
}
}()
select{}
}

0 comments on commit 4f3e65a

Please sign in to comment.