added native echo.HandlerFunc support and .staticDirectoryHandler bind

This commit is contained in:
Gani Georgiev committed 2023-07-24 21:11:55 +03:00
1 parent 99ea916c14
commit 8dfc90985b
7 files changed
+6938 -9881

No files matched your search

+13 -13
View File
@@ -193,19 +193,6 @@ func bindStaticAdminUI(app core.App, e *echo.Echo) error {
return nil
}
const totalAdminsCacheKey = "@totalAdmins"
func updateTotalAdminsCache(app core.App) error {
total, err := app.Dao().TotalAdmins()
if err != nil {
return err
}
app.Cache().Set(totalAdminsCacheKey, total)
return nil
}
func uiCacheControl() echo.MiddlewareFunc {
return func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
@@ -220,6 +207,19 @@ func uiCacheControl() echo.MiddlewareFunc {
}
}
const totalAdminsCacheKey = "@totalAdmins"
func updateTotalAdminsCache(app core.App) error {
total, err := app.Dao().TotalAdmins()
if err != nil {
return err
}
app.Cache().Set(totalAdminsCacheKey, total)
return nil
}
// installerRedirect redirects the user to the installer admin UI page
// when the application needs some preliminary configurations to be done.
func installerRedirect(app core.App) echo.MiddlewareFunc {