#109 move last url to new layout
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 7s

This commit is contained in:
Tim
2024-08-24 13:40:03 +02:00
parent b9190487bd
commit 148d064858
12 changed files with 92 additions and 170 deletions

View File

@@ -11,11 +11,12 @@ import (
func getHandler(db *sql.DB) http.Handler {
var router = http.NewServeMux()
router.HandleFunc("/", service.HandleStaticUi)
router.HandleFunc("/", service.HandleIndexAnd404)
// Serve static files (CSS, JS and images)
router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
router.HandleFunc("/app", service.App)
router.HandleFunc("POST /api/workout", service.NewWorkout(db))
router.HandleFunc("GET /api/workout", service.GetWorkouts(db))
router.HandleFunc("DELETE /api/workout", service.DeleteWorkout(db))