mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 06:47:20 +08:00
feat: 优化app路由加载
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
|
||||
"github.com/TheTNB/panel/internal/apps"
|
||||
"github.com/TheTNB/panel/internal/embed"
|
||||
"github.com/TheTNB/panel/internal/http/middleware"
|
||||
"github.com/TheTNB/panel/internal/service"
|
||||
@@ -259,6 +260,11 @@ func Http(r chi.Router) {
|
||||
r.Post("/start", systemctl.Start)
|
||||
r.Post("/stop", systemctl.Stop)
|
||||
})
|
||||
|
||||
r.Route("/apps", func(r chi.Router) {
|
||||
r.Use(middleware.MustLogin)
|
||||
apps.Boot(r)
|
||||
})
|
||||
})
|
||||
|
||||
r.NotFound(func(writer http.ResponseWriter, request *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user