2024-08-03 12:17:39 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (app *application) routes() http.Handler {
|
|
|
|
mux := chi.NewRouter()
|
2024-08-03 21:57:24 +02:00
|
|
|
|
|
|
|
mux.Get("/virtual-terminal", app.VirtualTerminal)
|
2024-08-04 18:17:56 +02:00
|
|
|
mux.Post("/payment-succeeded", app.PaymentSucceeded)
|
2024-08-06 13:29:32 +02:00
|
|
|
mux.Get("/charge-once", app.ChargeOnce)
|
|
|
|
|
|
|
|
fileServer := http.FileServer(http.Dir("./static"))
|
|
|
|
mux.Handle("/static/*", http.StripPrefix("/static", fileServer))
|
2024-08-03 21:57:24 +02:00
|
|
|
|
2024-08-03 12:17:39 +02:00
|
|
|
return mux
|
|
|
|
}
|