package main import ( "flag" "fmt" "golang_demo1/handlers" "net/http" ) func main() { portPtr := flag.Int("port", 8080, "port for webserver") flag.Parse() port := *portPtr fmt.Printf("Server is listening on port: %d", port) server := http.NewServeMux() server.HandleFunc("/status", handlers.StatusHandler) server.HandleFunc("/greeting", handlers.GreetingHandler) err := http.ListenAndServe(fmt.Sprintf("localhost:%d", port), server) if err != nil { fmt.Println("Error:", err) return } }