30 lines
559 B
Go
30 lines
559 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
"synlotto-website/handlers"
|
|
)
|
|
|
|
func main() {
|
|
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(w, r)
|
|
case "/submit-ticket":
|
|
handlers.SubmitTicket(w, r)
|
|
default:
|
|
http.NotFound(w, r)
|
|
}
|
|
})
|
|
|
|
log.Println("🚀 Lotto Tracker running on http://localhost:8080")
|
|
log.Fatal(http.ListenAndServe(":8080", nil))
|
|
}
|