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

27 lines
537 B
Go

package handler
import (
"me-fit/service"
"database/sql"
"net/http"
)
func workoutUi(db *sql.DB) http.Handler {
router := http.NewServeMux()
router.Handle("/workout", service.HandleWorkoutPage(db))
return router
}
func workoutApi(db *sql.DB) http.Handler {
router := http.NewServeMux()
router.Handle("POST /api/workout", service.HandleWorkoutNewComp(db))
router.Handle("GET /api/workout", service.HandleWorkoutGetComp(db))
router.Handle("DELETE /api/workout/{id}", service.HandleWorkoutDeleteComp(db))
return router
}