grim/goserve

Gross fix, but this will set the content type when we're serving up the custom 404 page
package main
import (
"fmt"
"net/http"
"os"
)
func getenv(name, def string) string {
val := os.Getenv(name)
if val != "" {
return val
}
return def
}
func main() {
fs := http.FileServer(http.Dir(getenv("GOSERVE_ROOT", "html")))
if prefix := getenv("GOSERVE_PREFIX", ""); prefix != "" {
fmt.Printf("stripping prefix %q\n", prefix)
fs = http.StripPrefix(prefix, fs)
}
notFoundPage := getenv("GOSERVE_404_PAGE", "")
http.Handle("/", basicHandler(fs, notFoundPage))
addr := getenv("GOSERVE_ADDR", ":3000")
fmt.Printf("Listening on %s\n", addr)
http.ListenAndServe(addr, nil)
}