aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.go b/main.go
index 998791a..a8afe72 100644
--- a/main.go
+++ b/main.go
@@ -7,6 +7,7 @@ import (
"html/template"
"log"
"net/http"
+ "os"
"strconv"
"time"
)
@@ -67,7 +68,10 @@ func (app *App) loginHandler(w http.ResponseWriter, r *http.Request) {
func main() {
//log.SetFlags(log.LstdFlags)
- store := NewPgStore()
+ if len(os.Args) == 1 {
+ log.Fatalf("Usage: %s <connect-string>\n", os.Args[0])
+ }
+ store := NewPgStore(os.Args[1])
template := template.Must(template.New("").ParseGlob("templates/*.tmpl"))
app := &App{store, template}
http.HandleFunc("/validate", app.validateHandler)