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

  1. package main
  2. import (
  3. "flag"
  4. "github.com/dooleydevin/me/api"
  5. "github.com/dooleydevin/me/config"
  6. "github.com/dooleydevin/me/db"
  7. "log"
  8. )
  9. func main() {
  10. var confPath = flag.String("config", "config.yaml", "path to YAML configuration file")
  11. flag.Parse()
  12. conf := config.LoadConfig(confPath)
  13. // Establish a database connection using the db package
  14. err := db.Connect(conf.DB.Address)
  15. if err != nil {
  16. log.Fatalf("Error establishing connection to database: %s", err)
  17. }
  18. // For now, the api requires a reference to the configuration and the db.
  19. // Ideally, the relevant variables of the configuration would be passed individually.
  20. api.Serve(conf, db.Pool)
  21. }