jokes-bapak2/api/app/v1/routes/health.go

20 lines
378 B
Go
Raw Normal View History

2021-07-09 12:13:19 +00:00
package routes
import (
"jokes-bapak2-api/app/v1/handler/health"
2021-08-04 09:03:53 +00:00
"time"
2021-07-14 18:17:01 +00:00
2021-07-09 12:13:19 +00:00
"github.com/gofiber/fiber/v2"
2021-08-04 09:03:53 +00:00
"github.com/gofiber/fiber/v2/middleware/cache"
2021-07-09 12:13:19 +00:00
)
func (d *Dependencies) Health() *fiber.App {
2021-07-09 12:13:19 +00:00
// Health check
deps := health.Dependencies{
Redis: d.Redis,
}
d.App.Get("/health", cache.New(cache.Config{Expiration: 30 * time.Minute}), deps.Health)
return d.App
2021-07-09 12:13:19 +00:00
}