mirror of
https://github.com/nicotsx/zerobyte.git
synced 2025-12-10 12:10:51 +01:00
feat: api
This commit is contained in:
19
internal/api/handlers.go
Normal file
19
internal/api/handlers.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user