29 lines
958 B
Go
29 lines
958 B
Go
|
|
package api
|
||
|
|
|
||
|
|
import (
|
||
|
|
"net/http"
|
||
|
|
)
|
||
|
|
|
||
|
|
func (h *Handler) RegisterRoutes(mux *http.ServeMux) {
|
||
|
|
mux.HandleFunc("/api/v1/auth/public-key", h.GetPublicKey)
|
||
|
|
mux.HandleFunc("/api/v1/auth/register", h.RegisterCert)
|
||
|
|
mux.HandleFunc("/api/v1/facturas", h.HandleFacturas)
|
||
|
|
mux.HandleFunc("/api/v1/facturas/anular", h.HandleFacturasAnular)
|
||
|
|
mux.HandleFunc("/api/v1/health", h.HealthCheck)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (h *Handler) HealthCheck(w http.ResponseWriter, r *http.Request) {
|
||
|
|
w.Header().Set("Content-Type", "application/json")
|
||
|
|
w.Write([]byte(`{"status":"ok"}`))
|
||
|
|
}
|
||
|
|
|
||
|
|
func (h *Handler) HandleFacturas(w http.ResponseWriter, r *http.Request) {
|
||
|
|
w.Header().Set("Content-Type", "application/json")
|
||
|
|
w.Write([]byte(`{"endpoint":"facturas","status":"not implemented"}`))
|
||
|
|
}
|
||
|
|
|
||
|
|
func (h *Handler) HandleFacturasAnular(w http.ResponseWriter, r *http.Request) {
|
||
|
|
w.Header().Set("Content-Type", "application/json")
|
||
|
|
w.Write([]byte(`{"endpoint":"facturas/anular","status":"not implemented"}`))
|
||
|
|
}
|