chore: add sign in tests
All checks were successful
Build and Push Docker Image / Explore-Gitea-Actions (push) Successful in 54s

This commit was merged in pull request #188.
This commit is contained in:
2024-09-27 12:33:52 +02:00
committed by Tim Wundenberg
parent 5d479b0811
commit da05ba5b56
3 changed files with 115 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
package handler
import (
"me-fit/db"
"me-fit/middleware"
"me-fit/service"
@@ -8,17 +9,17 @@ import (
"net/http"
)
func GetHandler(db *sql.DB) http.Handler {
func GetHandler(d *sql.DB) http.Handler {
var router = http.NewServeMux()
router.HandleFunc("/", service.HandleIndexAnd404(db))
router.HandleFunc("/", service.HandleIndexAnd404(d))
handlerAuth := NewHandlerAuth(db, service.NewServiceAuthImpl(db))
handlerAuth := NewHandlerAuth(d, service.NewServiceAuthImpl(db.NewDbAuthSqlite(d)))
// Serve static files (CSS, JS and images)
router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
handleWorkout(db, router)
handleWorkout(d, router)
handlerAuth.handle(router)