diff --git a/cmd/hubserver/main.go b/cmd/hubserver/main.go index 0f0e58c..70e4d84 100644 --- a/cmd/hubserver/main.go +++ b/cmd/hubserver/main.go @@ -31,12 +31,13 @@ type Stat struct { } func main() { - var hostPort,baseURL string + var hostPort,baseURL,database string flag.StringVar(&hostPort, "http", ":80", "host and port to listen on") flag.StringVar(&baseURL, "baseurl", "", "baseurl that the server should response with") + flag.StringVar(&database, "database", "localhost:9999", "database hostpost") flag.Parse() - dsn := fmt.Sprintf("postgres://%v:%v@localhost:9999/hub?sslmode=disable", "postgres", "simple") + dsn := fmt.Sprintf("postgres://%v:%v@%s/hub?sslmode=disable", "postgres", "simple", database) store, err := storage.New(dsn) if err != nil { log.Fatal(err)