Remove HTTP/REST server, keep gRPC only

This commit is contained in:
Alexander
2026-05-06 21:45:48 +02:00
parent 5fa46b2890
commit 67f46f740b
6 changed files with 37 additions and 155 deletions
+1 -18
View File
@@ -6,18 +6,15 @@ import (
"net"
"os"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"google.golang.org/grpc"
"gopkg.in/yaml.v2"
// My modules
"homelab.lan/music-agregator/internal"
"homelab.lan/music-agregator/internal/config"
"homelab.lan/music-agregator/internal/hello"
"homelab.lan/music-agregator/internal/indexer"
appRouter "homelab.lan/music-agregator/internal/router"
)
func main() {
@@ -33,21 +30,7 @@ func main() {
}
log.Info().Interface("config", cfg).Msg("Loaded config")
// start the grpc in another thread to not block the next http start
go serveGrpc(*cfg)
serveHttp()
}
func serveHttp() {
router := gin.Default()
appRouter.SetupRoutes(router)
router.GET("/ping", func(c *gin.Context) {
c.JSON(200, gin.H{
"message": "pong",
})
})
router.Run()
serveGrpc(*cfg)
}
func serveGrpc(config config.Config) {