Lots of changes and fixes
This commit is contained in:
9
main.go
9
main.go
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user