2021-07-09 12:13:19 +00:00
|
|
|
package routes
|
|
|
|
|
|
|
|
import (
|
2021-10-30 03:24:53 +00:00
|
|
|
"jokes-bapak2-api/handler/health"
|
2021-07-14 18:17:01 +00:00
|
|
|
|
2022-09-03 10:53:46 +00:00
|
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
"github.com/go-redis/redis/v8"
|
|
|
|
"github.com/minio/minio-go/v7"
|
2021-07-09 12:13:19 +00:00
|
|
|
)
|
|
|
|
|
2022-09-03 14:09:26 +00:00
|
|
|
// Health provides route for healthcheck endpoints.
|
2022-09-03 10:53:46 +00:00
|
|
|
func Health(bucket *minio.Client, cache *redis.Client) *chi.Mux {
|
|
|
|
dependency := &health.Dependencies{
|
|
|
|
Bucket: bucket,
|
|
|
|
Cache: cache,
|
2021-09-26 19:13:38 +00:00
|
|
|
}
|
2021-09-27 13:02:58 +00:00
|
|
|
|
2022-09-03 10:53:46 +00:00
|
|
|
router := chi.NewRouter()
|
|
|
|
|
|
|
|
router.Get("/", dependency.Health)
|
|
|
|
|
|
|
|
return router
|
2021-07-09 12:13:19 +00:00
|
|
|
}
|