// Homework 31, problem 1: Your own reply. // // Make the server reply with two lines of text: your name on the first line, // and your favourite food on the second. // // Run with: go run exercises/40/homework/01-your-own-reply.go package main import ( "fmt" "net/http" ) func handleHome(w http.ResponseWriter, r *http.Request) { // TODO: write your reply here, in place of this placeholder line: fmt.Fprintln(w, "TODO: replace this line") } func main() { http.HandleFunc("/", handleHome) 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) } }