order validation
This commit is contained in:
parent
2a4110ee8c
commit
de22166113
6 changed files with 164 additions and 7 deletions
6
main.go
6
main.go
|
|
@ -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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue