Read config and connect to db
This commit is contained in:
parent
528f329657
commit
2de8e46bf3
@ -1,13 +1,20 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.javil.eu/jacob1123/budgeteer/config"
|
||||||
"git.javil.eu/jacob1123/budgeteer/http"
|
"git.javil.eu/jacob1123/budgeteer/http"
|
||||||
"git.javil.eu/jacob1123/budgeteer/jwt"
|
"git.javil.eu/jacob1123/budgeteer/jwt"
|
||||||
"git.javil.eu/jacob1123/budgeteer/postgres"
|
"git.javil.eu/jacob1123/budgeteer/postgres"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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{}
|
tv := &jwt.TokenVerifier{}
|
||||||
|
|
||||||
h := &http.Handler{
|
h := &http.Handler{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user