Read config and connect to db

This commit is contained in:
Jan Bader 2016-12-20 10:13:18 +01:00
parent 528f329657
commit 2de8e46bf3

View File

@ -1,13 +1,20 @@
package main
import (
"git.javil.eu/jacob1123/budgeteer/config"
"git.javil.eu/jacob1123/budgeteer/http"
"git.javil.eu/jacob1123/budgeteer/jwt"
"git.javil.eu/jacob1123/budgeteer/postgres"
)
func main() {
us := &postgres.UserService{}
cfg, err := config.LoadConfig("config.json")
if err != nil {
panic("Could not load Config from config.json")
}
db := postgres.Connect(cfg.DatabaseHost, cfg.DatabaseUser, cfg.DatabasePassword, cfg.DatabaseName)
us := &postgres.UserService{DB: db}
tv := &jwt.TokenVerifier{}
h := &http.Handler{