24 lines
598 B
Go
24 lines
598 B
Go
package router
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"hyapp-luck-gateway/internal/config"
|
|
"hyapp-luck-gateway/internal/modules/luckygift"
|
|
"hyapp-luck-gateway/internal/requestid"
|
|
)
|
|
|
|
type Handlers struct {
|
|
LuckyGift *luckygift.Handler
|
|
}
|
|
|
|
func New(cfg config.Config, h Handlers) http.Handler {
|
|
mux := http.NewServeMux()
|
|
mux.HandleFunc("GET /healthz/ready", func(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Content-Type", "application/json")
|
|
_, _ = w.Write([]byte(`{"status":"ok","service":"luck-gateway"}`))
|
|
})
|
|
luckygift.RegisterRoutes(mux, h.LuckyGift)
|
|
return requestid.Middleware(mux)
|
|
}
|