2024-08-26 20:49:10 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
"github.com/go-chi/cors"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (app *application) routes() http.Handler {
|
|
|
|
mux := chi.NewRouter()
|
|
|
|
|
|
|
|
mux.Use(cors.Handler(cors.Options{
|
|
|
|
AllowedOrigins: []string{"https://*", "http://*"},
|
|
|
|
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
|
|
|
|
AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token"},
|
|
|
|
AllowCredentials: false,
|
|
|
|
MaxAge: 300,
|
|
|
|
}))
|
|
|
|
|
2024-08-27 11:28:11 +00:00
|
|
|
mux.Post("/invoice/create-and-send", app.CreateAndSendInvoice)
|
2024-08-26 20:49:10 +00:00
|
|
|
return mux
|
|
|
|
}
|