25 lines
403 B
Go
25 lines
403 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"log"
|
|
"net/http"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
bindhost = flag.String("bind", ":3031", "host/port to listen on")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintf(w, "PORTABLE=%s\n", os.Getenv("PORTABLE"))
|
|
})
|
|
|
|
log.Printf("listening for HTTP on %s", *bindhost)
|
|
log.Fatal(http.ListenAndServe(*bindhost, nil))
|
|
}
|