fix: restructure env handling for better testing capabillities #181
This commit was merged in pull request #195.
This commit is contained in:
@@ -2,13 +2,14 @@ package handler
|
||||
|
||||
import (
|
||||
"me-fit/service"
|
||||
"me-fit/types"
|
||||
|
||||
"database/sql"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func handleWorkout(db *sql.DB, router *http.ServeMux) {
|
||||
router.Handle("/workout", auth(db, service.HandleWorkoutPage(db)))
|
||||
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)))
|
||||
|
||||
Reference in New Issue
Block a user