Files
MusicServer/pkg/api/sync.go
Sebastian f9d6c24a97 Changed routing framework from mux to Gin.
Swagger doc is now included in the application.
A fronted can now be hosted from the application.
2022-01-29 17:52:33 +01:00

25 lines
409 B
Go

package api
import (
"github.com/gin-gonic/gin"
"music-server/pkg/server"
"net/http"
)
type Sync struct {
}
func NewSync() *Sync {
return &Sync{}
}
func (s *Sync) SyncGames(ctx *gin.Context) {
server.SyncGames()
ctx.JSON(http.StatusOK, "Games are synced")
}
func (s *Sync) ResetGames(ctx *gin.Context) {
server.ResetDB()
ctx.JSON(http.StatusOK, "Games and songs are deleted from the database")
}