16 lines
451 B
Go
16 lines
451 B
Go
package handler
|
|
|
|
import (
|
|
"me-fit/service"
|
|
|
|
"database/sql"
|
|
"net/http"
|
|
)
|
|
|
|
func handleWorkout(db *sql.DB, router *http.ServeMux) {
|
|
router.Handle("/workout", auth(db, service.HandleWorkoutPage(db)))
|
|
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)))
|
|
}
|