chore: use the echo framework instead of plain go net/http

This commit is contained in:
2025-06-02 17:35:07 +01:00
parent 4e6d939fd5
commit 9bd04f843a
8 changed files with 199 additions and 71 deletions
+8 -9
View File
@@ -1,12 +1,11 @@
package api
import "net/http"
func ClientRoutes(api *APIWrapper) (*http.ServeMux) {
mux := http.NewServeMux()
mux.HandleFunc("GET /", api.GetClientsHandler)
mux.HandleFunc("POST /", api.CreateClientHandler)
return mux
func (api *API) ClientRoutes() {
group := api.instance.Group("/clients")
group.GET("/", api.GetAllClientsHandler)
group.POST("/", api.CreateClientHandler)
group.GET("/:id", api.GetClientHandler)
group.PUT("/:id", api.UpdateClientHandler)
group.DELETE("/:id", api.DeleteClientHandler)
}