tweaked server.go to have a more informative servlet.Start() experience

This commit is contained in:
dtookey 2022-07-21 10:04:21 -04:00
parent 14cbf49e9a
commit 3b9ecb168f

View File

@ -68,9 +68,12 @@ func (s *VinegarServlet) ServeHTTP(w http.ResponseWriter, req *http.Request) {
func (s *VinegarServlet) Start() { func (s *VinegarServlet) Start() {
if len(s.Routes) < 1 { 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) err := http.ListenAndServe(s.Port, s)
if err != nil { if err != nil {