diff --git a/src/core/ui/handler.go b/src/core/ui/handler.go index 04682e8..abca47c 100644 --- a/src/core/ui/handler.go +++ b/src/core/ui/handler.go @@ -29,6 +29,19 @@ func (h *Handler) RegisterRoutes(mux *http.ServeMux, authGate func(http.Handler) staticDir := filepath.Join(h.appDir, "static") mux.Handle("GET /static/", http.StripPrefix("/static", http.FileServer(http.Dir(staticDir)))) mux.Handle("GET /", authGate(http.HandlerFunc(h.launcherPage))) + // App routes + for _, a := range DefaultApps("") { + if a.URL != "" && a.URL != "#" && a.URL != "/" && a.URL != "/admin" { + mux.Handle("GET "+a.URL, authGate(http.HandlerFunc(h.appPage(a.Name, a.Icon, a.Description)))) + } + } +} + +func (h *Handler) appPage(name, icon, desc string) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + component := AppPage(name, icon, desc) + component.Render(r.Context(), w) + } } func (h *Handler) launcherPage(w http.ResponseWriter, r *http.Request) {