Merge remote-tracking branch 'origin/main' into styling

This commit is contained in:
Johannes 2022-09-22 13:15:17 +02:00
commit 961a10915b
13 changed files with 193 additions and 74 deletions

10
main.go
View file

@ -19,6 +19,11 @@ func main() {
if e == nil {
log.SetOutput(logwriter)
}
if controllers.TemplateError != nil {
log.Fatalf("Error parsing templates: %s", controllers.TemplateError.Error())
}
configFile := flag.String(
"config",
"config/config.json",
@ -38,7 +43,10 @@ func main() {
// serve static files
staticHandler := http.FileServer(http.Dir("./static"))
db := sqldb.Connect(conf)
db, err := sqldb.Connect(conf)
if err != nil {
log.Fatalf(err.Error())
}
// Create repos
roomRepo := repositories.NewRoomRepo(db)
courseRepo := repositories.NewCourseRepo(db)