fix(api): ko json content type
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-05-13 12:14:57 -04:00
parent 162adfbe16
commit 57f81e5dd7
2 changed files with 23 additions and 16 deletions

View File

@@ -325,6 +325,13 @@ func (api *API) loadTemplates(
return nil
}
func (api *API) templateMiddleware(router *gin.Engine) gin.HandlerFunc {
return func(c *gin.Context) {
router.HTMLRender = *api.generateTemplates()
c.Next()
}
}
func loggingMiddleware(c *gin.Context) {
// Start timer
startTime := time.Now()
@@ -360,10 +367,3 @@ func loggingMiddleware(c *gin.Context) {
// Log result
log.WithFields(logData).Info(fmt.Sprintf("%s %s", c.Request.Method, c.Request.URL.Path))
}
func (api *API) templateMiddleware(router *gin.Engine) gin.HandlerFunc {
return func(c *gin.Context) {
router.HTMLRender = *api.generateTemplates()
c.Next()
}
}