Last active
August 29, 2015 13:56
-
-
Save sethgrid/8814431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
reader := bufio.NewReader(r.Body) | |
data := make([]byte, 225) | |
length, err := reader.Read(data) | |
if err != nil { | |
fmt.Println(err) | |
} | |
fmt.Printf("goecho: %s (%d)\n", data, length) | |
}) | |
fmt.Println("Starting Go Echo Server on port 9000") | |
http.ListenAndServe(":9000", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment