2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 优化app路由加载

This commit is contained in:
耗子
2024-11-11 01:07:37 +08:00
parent 1316c50a57
commit bb140ade7b
3 changed files with 7 additions and 3 deletions

View File

@@ -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) {