tweaked server.go to have a more informative servlet.Start() experience
This commit is contained in:
parent
14cbf49e9a
commit
3b9ecb168f
@ -68,9 +68,12 @@ func (s *VinegarServlet) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
func (s *VinegarServlet) Start() {
|
||||
if len(s.Routes) < 1 {
|
||||
|
||||
log.Fatal("No routes found for server. Nothing to listen and serve.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
log.Printf("Listening on [%s]\n", s.Port)
|
||||
|
||||
err := http.ListenAndServe(s.Port, s)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user