reportar error si no puede escuchar en puerto
This commit is contained in:
parent
4be58013b6
commit
51b7a806e2
2 changed files with 1 additions and 2 deletions
2
main.go
2
main.go
|
@ -48,7 +48,7 @@ func main() {
|
||||||
|
|
||||||
http.HandleFunc("/", index)
|
http.HandleFunc("/", index)
|
||||||
http.Handle("/cache/", &cache{db: db})
|
http.Handle("/cache/", &cache{db: db})
|
||||||
http.ListenAndServe(os.Args[1], nil)
|
log.Fatal(http.ListenAndServe(os.Args[1], nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
func index(w http.ResponseWriter, req *http.Request) {
|
func index(w http.ResponseWriter, req *http.Request) {
|
||||||
|
|
|
@ -76,7 +76,6 @@ func (r *cache) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
if len(parts) != 2 {
|
if len(parts) != 2 {
|
||||||
http.Error(w, "wrong amount of parts", http.StatusBadRequest)
|
http.Error(w, "wrong amount of parts", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
name := parts[1]
|
name := parts[1]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue