Better responses

This commit is contained in:
CornierKhan1 2018-09-07 08:49:08 +10:00 committed by GitHub
parent 89ec54ec66
commit 97f0ef435e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,7 +110,7 @@ type UNR struct {
} }
func main() { func main() {
fmt.Println("Starting HTTP connection (Port 8000)...") fmt.Println("Starting HTTP connection (Port 80)...")
http.HandleFunc("/", handler) // each request calls handler http.HandleFunc("/", handler) // each request calls handler
log.Fatal(http.ListenAndServe(":80", nil)) log.Fatal(http.ListenAndServe(":80", nil))
} }
@ -119,9 +119,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
// Get a sexy new timestamp to use. // Get a sexy new timestamp to use.
timestampnano := strconv.FormatInt(time.Now().UTC().Unix(), 10) timestampnano := strconv.FormatInt(time.Now().UTC().Unix(), 10)
fmt.Println(timestampnano)
timestamp := timestampnano + "000" timestamp := timestampnano + "000"
fmt.Println(timestamp)
fmt.Println("-=Incoming request!=-") fmt.Println("-=Incoming request!=-")
body, err := ioutil.ReadAll(r.Body) body, err := ioutil.ReadAll(r.Body)
@ -427,5 +425,5 @@ func handler(w http.ResponseWriter, r *http.Request) {
} }
} }
fmt.Println("-=End of Request.=-") fmt.Println("-=End of Request.=-"+"\n")
} }