package main import ( "log" "net/http" "git.icod.de/dalu/gopiwik/mongo" "git.icod.de/dalu/gopiwik/piwik" "gopkg.in/mgo.v2" ) const ( database = "piwik" siteCol = "sites" visitCol = "visits" ) func main() { ms, e := mgo.Dial("localhost") if e != nil { log.Fatal(e) } defer ms.Close() siteStorage := mongo.NewSiteStorage(ms, database, siteCol) visitStorage := mongo.NewVisitStorage(ms, database, visitCol) ph := piwik.NewPiwikHandler(siteStorage, visitStorage) http.Handle("/", ph) http.ListenAndServe(":8080", nil) }