I don't even remember this crap

This commit is contained in:
Dan Buch 2014-09-20 09:39:22 -05:00
parent 8dfd42a53f
commit 2dc819088c
2 changed files with 8 additions and 4 deletions

View File

@ -11,8 +11,8 @@ import (
func main() { func main() {
server := newCrispyServer() server := newCrispyServer()
http.Handle("/", server) http.Handle("/", server)
log.Printf("Serving on :9764 with %+v\n", server) log.Printf("Serving on :9799 with %+v\n", server)
log.Fatal(http.ListenAndServe(":9764", nil)) log.Fatal(http.ListenAndServe(":9799", nil))
} }
type crispyServer struct { type crispyServer struct {
@ -26,6 +26,10 @@ func newCrispyServer() *crispyServer {
} }
func (me *crispyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (me *crispyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/DIE" && r.Method == "POST" {
me.logstasher.Fatal("OH GOSH")
}
j, err := json.Marshal(r) j, err := json.Marshal(r)
if err == nil { if err == nil {
me.logstasher.Println(string(j)) me.logstasher.Println(string(j))

View File

@ -15,8 +15,8 @@ func main() {
} }
http.Handle("/", server) http.Handle("/", server)
log.Printf("Serving on :9764 with %+v\n", server) log.Printf("Serving on :9799 with %+v\n", server)
log.Fatal(http.ListenAndServe(":9764", nil)) log.Fatal(http.ListenAndServe(":9799", nil))
} }
type crispyServer struct { type crispyServer struct {