Skip to content

Instantly share code, notes, and snippets.

@darron
Created August 16, 2017 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darron/861c1be75bcc6c17e443f2e41a939ef6 to your computer and use it in GitHub Desktop.
Save darron/861c1be75bcc6c17e443f2e41a939ef6 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
"math/rand"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%d", rand.Intn(9999))
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment