Skip to content

Instantly share code, notes, and snippets.

@phoorichet
Created April 4, 2017 06:33
Show Gist options
  • Save phoorichet/3a62001a1e9fc84047385b922fe45531 to your computer and use it in GitHub Desktop.
Save phoorichet/3a62001a1e9fc84047385b922fe45531 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"log"
"net/http"
"time"
)
func main() {
addr := ":9000"
log.Printf("Starting simple http server on %s", addr)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "timestamp: %s", time.Now())
})
log.Fatal(http.ListenAndServe(":9000", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment