package main import ( "fmt" "git.rouggy.com/rouggy/RaceBot/config" "git.rouggy.com/rouggy/RaceBot/database" "git.rouggy.com/rouggy/RaceBot/models" "git.rouggy.com/rouggy/RaceBot/router" "github.com/gin-gonic/gin" ) func main() { config.Load() database.SQLiteDBConnect() defer database.GetDB().Close() SQLiteMigrate() ServeApplication() } func ServeApplication() { gin.SetMode(gin.ReleaseMode) r := gin.Default() router.SetupRoutes(r) fmt.Println("Server is running on port:", config.HTTPPort) r.Run(":" + config.HTTPPort) } func SQLiteMigrate() { db := database.GetDB() if err := db.AutoMigrate(&models.Release{}, &models.Race{}).Error; err != nil { panic("[Database] Failed migrating database: ") } fmt.Println("[Database] Database successfully migrated") }