2022-02-27 16:51:56 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
bindhost = flag.String("bind", ":3031", "host/port to listen on")
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
2022-03-26 17:37:12 +00:00
|
|
|
fmt.Fprintln(w, "hello world :)")
|
2022-02-27 16:51:56 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
log.Printf("listening for HTTP on %s", *bindhost)
|
|
|
|
log.Fatal(http.ListenAndServe(*bindhost, nil))
|
|
|
|
}
|