mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
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:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user