Skip to content

Commit

Permalink
minor changes in main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Reisinger committed Nov 10, 2021
1 parent 4aaf4a0 commit 7d7c603
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ func main() {
}

if *s {
addr := "localhost:8000"
url := "/api/v1/"
c := api.Checkers(checkers)
http.HandleFunc("/api/v1/", c.Handler)
log.Fatal(http.ListenAndServe(":8000", nil))
http.HandleFunc(url, c.Handler)
log.Printf("starting API server at %s", addr+url)
log.Fatal(http.ListenAndServe(addr, nil))
} else {

log.SetFlags(0)
log.SetPrefix(os.Args[0] + ": ")

Expand All @@ -50,7 +52,6 @@ func main() {
}

results := checkip.Run(checkers, ipaddr)

cmd.Print(results)
}
}

0 comments on commit 7d7c603

Please sign in to comment.