[tmp] disabled db support
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Piotr Biernat 2022-04-23 13:13:59 +02:00
parent 69b4179102
commit ceb3c4bba5

View File

@ -10,7 +10,6 @@ import (
"git.pbiernat.dev/golang/rest-api-prototype/internal/app"
"git.pbiernat.dev/golang/rest-api-prototype/internal/app/config"
"git.pbiernat.dev/golang/rest-api-prototype/internal/app/database"
"git.pbiernat.dev/golang/rest-api-prototype/internal/app/handler"
)
@ -26,14 +25,15 @@ func main() {
}
httpAddr := net.JoinHostPort(config.GetEnv("SERVER_IP", defHttpIp), config.GetEnv("SERVER_PORT", defHttpPort))
dbConnStr := config.GetEnv("DATABASE_URL", defDbUrl)
// dbConnStr := config.GetEnv("DATABASE_URL", defDbUrl)
dbc, err := database.Connect(dbConnStr)
if err != nil {
log.Panicf("Unable to connect to database: %v\n", err)
}
// dbc, err := database.Connect(dbConnStr)
// if err != nil {
// log.Panicf("Unable to connect to database: %v\n", err)
// }
env := &handler.Env{httpAddr, dbc}
// env := &handler.Env{httpAddr, dbc}
env := &handler.Env{httpAddr, nil}
srv := app.NewServer(env)
go srv.Start()