package main import ( "fmt" "net/http" ) func handleHome(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "This is the home page.") } func handleAbout(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "This server has three pages.") } func handleContact(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Write to Keiko at the front desk.") } func main() { http.HandleFunc("GET /{$}", handleHome) http.HandleFunc("GET /about", handleAbout) http.HandleFunc("GET /contact", handleContact) fmt.Println("Server running at http://localhost:8080") fmt.Println("Press Ctrl+C to stop it.") err := http.ListenAndServe("localhost:8080", nil) if err != nil { fmt.Println("Server stopped:", err) } }