Add arguments for database
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Peter Stuifzand 2019-03-18 22:06:55 +01:00
parent 4c1734095e
commit 07d94a789a

View File

@ -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)