fix: prevent 404 on initial startup by moving h.initialize after hooks

- I don't know why this works. Need to look further into it tomorrow :)
This commit is contained in:
henrygd
2025-03-06 05:38:33 -05:00
parent d25c7c58c1
commit b1fc715ec9

View File

@@ -64,11 +64,6 @@ func (h *Hub) BootstrapHub() (*Hub, error) {
}
}
// initial setup
if err := h.initialize(); err != nil {
return nil, err
}
// serve web ui
h.OnServe().BindFunc(h.startServer)
// set up scheduled jobs
@@ -85,6 +80,11 @@ func (h *Hub) BootstrapHub() (*Hub, error) {
// start system updates
h.sm.Initialize()
// initial setup
if err := h.initialize(); err != nil {
return nil, err
}
return h, nil
}
@@ -145,7 +145,6 @@ func (h *Hub) initialize() error {
// Start starts the hub application / server
func (h *Hub) Start() error {
// Use type assertion to access the Start method
if pb, ok := h.App.(*pocketbase.PocketBase); ok {
return pb.Start()
}