Lots of changes around viewing tickets from css perspective logic changes nwe handlers and service triggers... just lots of stuff...

This commit is contained in:
2025-03-28 10:05:54 +00:00
parent e13b375af7
commit 23e0208317
22 changed files with 410 additions and 148 deletions

View File

@@ -4,10 +4,10 @@ import (
"log"
"net/http"
"synlotto-website/handlers"
services "synlotto-website/handlers/admin"
"synlotto-website/helpers"
"synlotto-website/middleware"
"synlotto-website/models"
services "synlotto-website/services/admin"
"synlotto-website/storage"
"github.com/gorilla/csrf"
@@ -25,6 +25,9 @@ func main() {
mux := http.NewServeMux()
// Styling
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
mux.HandleFunc("/", handlers.Home(db))
mux.HandleFunc("/new", handlers.NewDraw) // ToDo: needs to be wrapped in admin auth
mux.HandleFunc("/submit", handlers.Submit)
@@ -40,7 +43,7 @@ func main() {
mux.HandleFunc("/account/tickets/my_tickets", handlers.GetMyTickets(db))
// Admin Pages
mux.HandleFunc("/admin/match", services.AdminMatchHandler)
mux.HandleFunc("/admin/triggers", services.AdminTriggersHandler(db))
log.Println("🌐 Running on http://localhost:8080")
http.ListenAndServe(":8080", helpers.RateLimit(csrfMiddleware(mux)))