aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Hurst2016-04-16 00:30:38 -0600
committerDavid Hurst2016-04-16 00:30:38 -0600
commit0385b1081aab533fce98f5ec1dd9b8d476d65581 (patch)
tree4d4fb25eeae515a8726a8cbd718afceb67cd9bcc
parent0994d59e4531fe2bda0bbdf3614b5eb8188327c7 (diff)
downloadtorpedo-0385b1081aab533fce98f5ec1dd9b8d476d65581.tar.gz
torpedo-0385b1081aab533fce98f5ec1dd9b8d476d65581.zip
add port to command line options
-rw-r--r--main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.go b/main.go
index afaef44..5f6a5cb 100644
--- a/main.go
+++ b/main.go
@@ -3,6 +3,7 @@ package main
3import ( 3import (
4 "bytes" 4 "bytes"
5 "encoding/xml" 5 "encoding/xml"
6 "flag"
6 "fmt" 7 "fmt"
7 "github.com/sideshowdave7/torpedo" 8 "github.com/sideshowdave7/torpedo"
8 "net/url" 9 "net/url"
@@ -38,11 +39,13 @@ func (ping) Get(values url.Values) (int, string) {
38} 39}
39 40
40func main() { 41func main() {
42 var port = flag.Int("port", 8000, "Port number to listen on")
43 flag.Parse()
41 44
42 ping := new(ping) 45 ping := new(ping)
43 46
44 var api = new(torpedo.API) 47 var api = new(torpedo.API)
45 api.AddResource(ping, "/rest/ping.view") 48 api.AddResource(ping, "/rest/ping.view")
46 api.Start(3000) 49 api.Start(*port)
47 50
48} 51}