chore(auth): add service structs and test error handling
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 49s
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 49s
This commit is contained in:
@@ -13,13 +13,18 @@ import (
|
||||
func GetHandler(db *sql.DB) http.Handler {
|
||||
router := http.NewServeMux()
|
||||
|
||||
router.HandleFunc("/$", handleIndex(db))
|
||||
router.HandleFunc("/{$}", handleIndex(db))
|
||||
router.HandleFunc("/", handleNotFound(db))
|
||||
|
||||
router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
|
||||
|
||||
router.Handle("/auth/", authUi(db))
|
||||
router.Handle("/api/auth/", authApi(db))
|
||||
authHandler := AuthHandler{
|
||||
db: db,
|
||||
service: service.NewAuthService(db),
|
||||
}
|
||||
|
||||
router.Handle("/auth/", authHandler.authUi())
|
||||
router.Handle("/api/auth/", authHandler.authApi())
|
||||
|
||||
router.Handle("/workout", authMiddleware(db, workoutUi(db)))
|
||||
router.Handle("/api/workout", authMiddleware(db, workoutApi(db)))
|
||||
|
||||
Reference in New Issue
Block a user