package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
if (r.URL.Path[1:] == "spider") {
fmt.Fprintf(w, "
%s ... You Guessed rightHi there, I have mixed feelings about the %s! What is your worst nightmare? %s%s%s", r.URL.Path[1:], r.URL.Path[1:], "
")
} else {
fmt.Fprintf(w, "%s ... Guess which animal scaresHi there, I love the %s! %s%s%s", r.URL.Path[1:], r.URL.Path[1:], " ")
}
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}