/* http.go * * HTTP status server. */ package main import ( "fmt" "http" "orchestra" ) /* default ports are all in server.go */ func StartHTTP() { go httpServer() } func returnStatus(w http.ResponseWriter, r *http.Request) { tasks, players := DispatchStatus() fmt.Fprintf(w, "

Tasks Waiting: %d

\n", tasks) fmt.Fprintf(w, "

Players Idle:

\n") } func httpServer() { laddr := fmt.Sprintf(":%d", orchestra.DefaultHTTPPort) http.HandleFunc("/", returnStatus) http.ListenAndServe(laddr, nil) }