Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.32 KB | None | 0 0
  1. package main
  2. import (
  3.     "fmt"
  4.     "net/http"
  5.     "time"
  6. )
  7. func handler(response http.ResponseWriter, request *http.Request) {
  8.     time.Sleep(time.Second * 5)
  9.     fmt.Fprintf(response, "Hello, %s!", request.URL.Path[1:])
  10. }
  11. func main() {
  12.     http.HandleFunc("/", handler)
  13.     http.ListenAndServe(":8001", nil)
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement