update
This commit is contained in:
parent
7362a1e5d8
commit
81e5769bef
@ -2,13 +2,14 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"git.rouggy.com/rouggy/RaceBot/api"
|
||||
"git.rouggy.com/rouggy/RaceBot/internal/config"
|
||||
"git.rouggy.com/rouggy/RaceBot/internal/database"
|
||||
"git.rouggy.com/rouggy/RaceBot/models"
|
||||
"github.com/jinzhu/gorm"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -38,6 +39,7 @@ func main() {
|
||||
|
||||
func SQLiteMigrate() {
|
||||
db := database.GetDB()
|
||||
db.LogMode(false)
|
||||
if err := db.AutoMigrate(&models.Release{}, &models.Race{}).Error; err != nil {
|
||||
panic("[Database] Failed migrating database: ")
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.rouggy.com/rouggy/RaceBot/controllers"
|
||||
"git.rouggy.com/rouggy/RaceBot/internal/domain"
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -21,7 +22,7 @@ func (s *Server) Start(cfg *domain.Config) error {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
r := gin.Default()
|
||||
s.SetupRoutes(r)
|
||||
fmt.Println("Server is running on port:", cfg.Port)
|
||||
fmt.Println("[Server ]Server is running on port", cfg.Port)
|
||||
err := r.Run(s.listenAddr)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user