Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Pavlovichev committed Feb 11, 2018
1 parent 20db4c3 commit 51b07a1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# http-debug-server
# http-debug-server

The application provide ability to debug HTTP requests

## Usage

```
http-debug-server -p 8081
```

and then:

```
curl -X POST -H 'X-Api-Key: secret' http://localhost:8081/test?foo=bar
```

Output:
```
2018/02/11 16:49:07 POST /test?foo=bar HTTP/1.1
Host: localhost:8081
Accept: */*
Content-Length: 2
Content-Type: application/x-www-form-urlencoded
User-Agent: curl/7.54.0
X-Api-Key: secret
{}
```
8 changes: 6 additions & 2 deletions http-debug-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func main() {
app := cli.NewApp()
app.Version = "0.9.0"
app.Description = "The application provide ability to debug HTPP requests"
app.Description = "The application provide ability to debug HTTP requests"
app.Usage = "HTTP Debug"

app.Flags = []cli.Flag{
Expand All @@ -33,7 +33,11 @@ func main() {
})

log.Println("Listening on: ", port)
http.ListenAndServe(fmt.Sprintf(":%d", port), nil)
err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil)

if err != nil {
log.Fatalln(err.Error())
}

return nil
}
Expand Down

0 comments on commit 51b07a1

Please sign in to comment.