feat: api

This commit is contained in:
Nicolas Meienberger
2025-08-10 16:51:16 +02:00
parent 2c38a551cc
commit fd91751673
8 changed files with 177 additions and 43 deletions

19
internal/api/handlers.go Normal file
View File

@@ -0,0 +1,19 @@
package api
import (
"net/http"
"github.com/gin-gonic/gin"
)
// SetupHandlers sets up the API routes for the application.
func SetupHandlers(router *gin.Engine) {
router.GET("/api/health", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
})
router.GET("/api/volumes", ListVolumes)
router.POST("/api/volumes", CreateVolume)
router.GET("/api/volumes/:name", GetVolume)
router.DELETE("/api/volumes/:name", DeleteVolume)
}