udemy-go-web-2/cmd/web/routes.go
2024-08-06 13:29:32 +02:00

21 lines
421 B
Go

package main
import (
"net/http"
"github.com/go-chi/chi/v5"
)
func (app *application) routes() http.Handler {
mux := chi.NewRouter()
mux.Get("/virtual-terminal", app.VirtualTerminal)
mux.Post("/payment-succeeded", app.PaymentSucceeded)
mux.Get("/charge-once", app.ChargeOnce)
fileServer := http.FileServer(http.Dir("./static"))
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
return mux
}