migration to chi

This commit is contained in:
2025-03-12 16:30:40 +03:00
parent ae81fbcce9
commit 45bb32e7a6
46 changed files with 1352 additions and 1323 deletions
+17
View File
@@ -0,0 +1,17 @@
package routes
import (
"backend/database"
"github.com/go-chi/chi/v5"
"net/http"
)
func RegisterGamesRoutes(r chi.Router) {
r.Get("/{id:[0-9]+}", getGame)
}
func getGame(w http.ResponseWriter, r *http.Request) {
id := IURLParam(r, "id")
game, err := database.FetchGame(int32(id))
Response(w, err, game)
}