From 8633794876542b9fa7c0d0469794cad4d1210558 Mon Sep 17 00:00:00 2001 From: sergi Date: Tue, 9 Jul 2024 14:25:05 +0200 Subject: [PATCH] fix issue with middleware overwrite routes in the WhenReady function --- evo.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/evo.go b/evo.go index aaa61d3..1dd96e2 100644 --- a/evo.go +++ b/evo.go @@ -132,6 +132,14 @@ func Run() { for _, item := range statics { app.Static(item[0], item[1]) } + + for _, item := range onReady { + item() + } + for prefix, _ := range viewList { + applyViewFunction(prefix) + } + if Any != nil { app.Use(func(ctx *fiber.Ctx) error { r := Upgrade(ctx) @@ -152,12 +160,6 @@ func Run() { }) } - for _, item := range onReady { - item() - } - for prefix, _ := range viewList { - applyViewFunction(prefix) - } var err error if config.Server.HTTPS { cer, err := tls.LoadX509KeyPair(GuessPath(config.Server.Cert), GuessPath(config.Server.Key))