Personal data aggregator. Very much a work in progress, with no guarantee of being finished.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
668 B

package main
import (
"flag"
"github.com/dooleydevin/me/api"
"github.com/dooleydevin/me/config"
"github.com/dooleydevin/me/db"
"log"
)
func main() {
var confPath = flag.String("config", "config.yaml", "path to YAML configuration file")
flag.Parse()
conf := config.LoadConfig(confPath)
// Establish a database connection using the db package
err := db.Connect(conf.DB.Address)
if err != nil {
log.Fatalf("Error establishing connection to database: %s", err)
}
// For now, the api requires a reference to the configuration and the db.
// Ideally, the relevant variables of the configuration would be passed individually.
api.Serve(conf, db.Pool)
}