order validation

This commit is contained in:
bronku 2026-11-08 19:05:53 +01:00
parent 2a4110ee8c
commit de22166113
6 changed files with 164 additions and 7 deletions

View file

@ -13,6 +13,7 @@ import (
"path/filepath"
"piekarnikgosipl/data"
"piekarnikgosipl/html"
"piekarnikgosipl/orders"
"piekarnikgosipl/utils"
"sort"
"strings"
@ -206,6 +207,9 @@ func main() {
if len(os.Args) > 1 {
return
}
server := http.ServeMux{}
server.Handle("/", http.FileServer(http.Dir("www")))
server.HandleFunc("POST /order/", orders.OrderHandler)
log.Println("listening on :8000")
log.Fatal(http.ListenAndServe(":8000", http.FileServer(http.Dir("www"))))
log.Fatal(http.ListenAndServe(":8000", &server))
}