aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index 3022347..04a5f4f 100644
--- a/main.go
+++ b/main.go
@@ -5,6 +5,7 @@ import (
"net/http"
"io"
"flag"
+ "fmt"
)
var rawBody = false
@@ -46,8 +47,9 @@ func handle(w http.ResponseWriter, r *http.Request) {
func main() {
b := flag.Bool("b", false, "Read raw body")
+ p := flag.Int("p", 8080, "Port to use")
flag.Parse()
rawBody = *b
http.HandleFunc("/", handle)
- log.Fatal(http.ListenAndServe(":8080", nil))
+ log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *p), nil))
}