Lots of changes and fixes

This commit is contained in:
2025-03-24 23:23:29 +00:00
parent 09b2ad8c56
commit d2013ec5c5
9 changed files with 116 additions and 54 deletions

View File

@@ -4,9 +4,12 @@ import (
"log"
"net/http"
"synlotto-website/handlers"
"synlotto-website/storage"
)
func main() {
db := storage.InitDB("synlotto.db")
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/":
@@ -16,14 +19,14 @@ func main() {
case "/submit":
handlers.Submit(w, r)
case "/ticket":
handlers.NewTicket(w, r)
handlers.NewTicket(db)
case "/submit-ticket":
handlers.SubmitTicket(w, r)
handlers.SubmitTicket(db)
default:
http.NotFound(w, r)
}
})
log.Println("🚀 Lotto Tracker running on http://localhost:8080")
log.Println("🌐 Running on http://localhost:8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}