step-1
Vyacheslav Bakhmutov 2014-03-06 16:07:17 +04:00
parent 59e999e7cd
commit dcff4accf9
1 changed files with 22 additions and 0 deletions

22
src/main.go Normal file
View File

@ -0,0 +1,22 @@
package main
import (
"fmt"
"github.com/codegangsta/martini"
"net/http"
"net/http/httputil"
)
func main() {
api := martini.Classic()
api.Any("/", func(res http.ResponseWriter, req *http.Request,) {
if dumped, err := httputil.DumpRequest(req, true); err == nil {
res.WriteHeader(200)
res.Write(dumped)
} else {
res.WriteHeader(500)
fmt.Fprintf(res, "Error: %v", err)
}
})
api.Run()
}