Files
website/main.go
2025-03-24 23:23:29 +00:00

33 lines
607 B
Go

package main
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 "/":
handlers.Home(w, r)
case "/new":
handlers.NewDraw(w, r)
case "/submit":
handlers.Submit(w, r)
case "/ticket":
handlers.NewTicket(db)
case "/submit-ticket":
handlers.SubmitTicket(db)
default:
http.NotFound(w, r)
}
})
log.Println("🌐 Running on http://localhost:8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}