Improved layout middleware

This commit is contained in:
2019-06-03 14:53:04 +09:00
parent 3268488b7b
commit cf68184c46
6 changed files with 24 additions and 18 deletions

View File

@ -45,8 +45,8 @@ func configure(app *aero.Application) *aero.Application {
// Middleware
app.Use(
middleware.Recover,
middleware.OpenGraph,
middleware.Layout,
middleware.Log,
middleware.Session,
middleware.UserInfo,
@ -70,6 +70,11 @@ func configure(app *aero.Application) *aero.Application {
// Close the database node on shutdown
app.OnEnd(arn.Node.Close)
// Don't push when an underscore URL has been requested
app.AddPushCondition(func(ctx aero.Context) bool {
return !strings.HasPrefix(ctx.Path(), "/_")
})
// Show errors in the console
app.OnError(func(ctx aero.Context, err error) {
color.Red(err.Error())