fix (main): reorder boot sequence

the issue is from plugins we could not generate a endpoint in the Onload
section, leading to some weird piece of code
This commit is contained in:
MickaelK 2025-11-27 16:49:19 +11:00
parent 359a6c05d1
commit d69e75cbb6

View file

@ -31,12 +31,12 @@ func Run(router *mux.Router, app App) {
if len(Hooks.Get.Starter()) == 0 { if len(Hooks.Get.Starter()) == 0 {
check(ErrNotFound, "Missing starter plugin. err=%s") check(ErrNotFound, "Missing starter plugin. err=%s")
} }
for _, obj := range Hooks.Get.HttpEndpoint() {
obj(router, &app)
}
for _, fn := range Hooks.Get.Onload() { for _, fn := range Hooks.Get.Onload() {
fn() fn()
} }
for _, obj := range Hooks.Get.HttpEndpoint() {
obj(router, &app)
}
server.Build(router, app) server.Build(router, app)
server.PluginRoutes(router) server.PluginRoutes(router)
server.CatchAll(router, app) server.CatchAll(router, app)