Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "log"
  6. "net/http"
  7. )
  8.  
  9. func handler(w http.ResponseWriter, r *http.Request) {
  10. fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
  11. }
  12.  
  13. func main() {
  14. http.HandleFunc("/", handler)
  15. log.Fatal(http.ListenAndServe(":8080", nil))
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement