dev env
This commit is contained in:
parent
6185a59de9
commit
9e16843a29
8 changed files with 178 additions and 123 deletions
4
main.go
4
main.go
|
|
@ -210,13 +210,11 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
orders.InitStripe(os.Getenv("STRIPE_SECRET_KEY"))
|
||||
|
||||
mux := http.ServeMux{}
|
||||
|
||||
mux.Handle("/", http.FileServer(http.Dir("www")))
|
||||
mux.Handle("POST /order", orders.Limit(http.HandlerFunc(orders.OrderHandler), 10*time.Second, 5))
|
||||
mux.HandleFunc("POST /webhook", orders.WebhookHandler(os.Getenv("STRIPE_WEBHOOK_SECRET")))
|
||||
mux.HandleFunc("POST /webhook", orders.WebhookHandler)
|
||||
|
||||
log.Println("listening on :8000")
|
||||
log.Fatal(http.ListenAndServe(":8000", &mux))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue