diff --git a/main.go b/main.go new file mode 100644 index 0000000..93da03e --- /dev/null +++ b/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "local/args" + "net/http" +) + +func main() { + as := args.NewArgSet() + as.Append(args.INT, "p", "port to listen on", "8101") + as.Append(args.STRING, "f", "file to abuse", "/tmp/ledger-ui.dat") + if err := as.Parse(); err != nil { + panic(err) + } + ledger, err := NewLedger(as.GetString("f")) + if err != nil { + panic(err) + } + if err := http.ListenAndServe(":"+fmt.Sprint(as.GetInt("p")), Server{ledger: ledger}); err != nil { + panic(err) + } +} diff --git a/public/index.html b/public/index.html index 13d9583..18cbfe0 100644 --- a/public/index.html +++ b/public/index.html @@ -21,11 +21,11 @@