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:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user