Fixed some bugs with songs not found made the application crash. Now checking if song exists and if not, remove song from DB and find another one. Frontend is now decoupled from the backend.

This commit is contained in:
2024-05-18 11:03:03 +02:00
parent 16f2e07bd1
commit a863702b22
8 changed files with 57 additions and 59 deletions

View File

@@ -66,7 +66,7 @@ func SetupRestServer(swagger embed.FS) {
musicGroup := router.Group("/music")
{
musicGroup.GET("", music.GetSong)
musicGroup.GET("first", music.GetMusicFirst)
musicGroup.GET("soundTest", music.GetSoundCheckSong)
musicGroup.GET("reset", music.ResetMusic)
musicGroup.GET("rand", music.GetRandomSong)
musicGroup.GET("rand/low", music.GetRandomSongLowChance)
@@ -86,7 +86,7 @@ func SetupRestServer(swagger embed.FS) {
router.GET("/version", index.GetVersion)
router.GET("/test", index.GetDBTest)
router.StaticFS("/swagger", helpers.EmbedFolder(swagger, "swagger", false))
router.Use(static.Serve("/", static.LocalFile("frontend/dist", true)))
router.Use(static.Serve("/", static.LocalFile("/frontend", true)))
port := os.Getenv("PORT")
if port == "" {