2024-08-03 10:17:39 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (app *application) routes() http.Handler {
|
|
|
|
mux := chi.NewRouter()
|
2024-08-03 19:57:24 +00:00
|
|
|
|
|
|
|
mux.Get("/virtual-terminal", app.VirtualTerminal)
|
2024-08-04 16:17:56 +00:00
|
|
|
mux.Post("/payment-succeeded", app.PaymentSucceeded)
|
2024-08-07 09:56:53 +00:00
|
|
|
mux.Get("/widget/{id}", app.ChargeOnce)
|
2024-08-06 11:29:32 +00:00
|
|
|
|
|
|
|
fileServer := http.FileServer(http.Dir("./static"))
|
|
|
|
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
|
2024-08-03 19:57:24 +00:00
|
|
|
|
2024-08-03 10:17:39 +00:00
|
|
|
return mux
|
|
|
|
}
|