Skip to content

Commit

Permalink
add cache middleware on initApp
Browse files Browse the repository at this point in the history
Signed-off-by: Avelino <avelinorun@gmail.com>
  • Loading branch information
avelino committed Dec 23, 2021
1 parent f192a3f commit bc0b483
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions middlewares/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func initApp() {
if config.PrestConf.CORSAllowOrigin != nil {
MiddlewareStack = append(MiddlewareStack, Cors(config.PrestConf.CORSAllowOrigin, config.PrestConf.CORSAllowHeaders))
}
if config.PrestConf.Cache != false {
MiddlewareStack = append(MiddlewareStack, CacheMiddleware())
}
}
app = negroni.New(MiddlewareStack...)
}
Expand Down

0 comments on commit bc0b483

Please sign in to comment.