This repository has been archived on 2025-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
web-app-template/handler/workout.go
Tim Wundenberg a70138f2f7
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 47s
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 55s
fix: restructure env handling for better testing capabillities #181
2024-09-29 23:55:47 +02:00

17 lines
521 B
Go

package handler
import (
"me-fit/service"
"me-fit/types"
"database/sql"
"net/http"
)
func handleWorkout(db *sql.DB, router *http.ServeMux, serverSettings *types.ServerSettings) {
router.Handle("/workout", auth(db, service.HandleWorkoutPage(db, serverSettings)))
router.Handle("POST /api/workout", auth(db, service.HandleWorkoutNewComp(db)))
router.Handle("GET /api/workout", auth(db, service.HandleWorkoutGetComp(db)))
router.Handle("DELETE /api/workout/{id}", auth(db, service.HandleWorkoutDeleteComp(db)))
}