Permalink
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (15 sloc) 317 Bytes
package main
import (
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
w.Write([]byte("foobar"))
w.WriteHeader(http.StatusBadRequest)
})
err := http.ListenAndServe(":8080", nil)
if err != nil {
log.Fatalf("Error starting http server: %v", err)
}
}