Databases CRUD

This commit is contained in:
Pijus Kamandulis
2024-02-10 17:17:34 +02:00
commit f30d0528bc
10 changed files with 340 additions and 0 deletions

18
api/router.go Normal file
View File

@@ -0,0 +1,18 @@
package api
import (
"github.com/gin-gonic/gin"
"github.com/pikami/cosmium/api/handlers"
)
func CreateRouter() *gin.Engine {
router := gin.Default()
router.GET("/dbs/:id", handlers.GetDatabase)
router.DELETE("/dbs/:id", handlers.DeleteDatabase)
router.GET("/dbs", handlers.GetAllDatabases)
router.POST("/dbs", handlers.CreateDatabase)
router.GET("/", handlers.GetServerInfo)
return router
}