tbs
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 47s

This commit is contained in:
2024-09-17 22:47:54 +02:00
parent 6f22e066ab
commit f184e261ee
5 changed files with 93 additions and 10 deletions

View File

@@ -16,11 +16,16 @@ func GetHandler(db *sql.DB) http.Handler {
// Serve static files (CSS, JS and images)
router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
handleWorkout(db, router)
router.Handle("/auth/", authUi(db))
router.Handle("/api/auth/", authApi(db))
handleAuth(db, router)
router.Handle("/workout", auth(db, workoutUi(db)))
router.Handle("/api/workout", auth(db, workoutApi(db)))
router.Handle("/api/workout/", auth(db, workoutApi(db)))
return middleware.Logging(middleware.EnableCors(router))
return middleware.Logging(
middleware.EnableCors(
router))
}
func auth(db *sql.DB, h http.Handler) http.Handler {