fix health endpoint, nits

This commit is contained in:
Egor 2026-02-09 02:57:30 -08:00
parent da4de081da
commit b4205c5195
2 changed files with 13 additions and 9 deletions

View file

@ -1,5 +1,6 @@
services:
prism:
container_name: prism
image: ghcr.io/lone-cloud/prism:dev
ports:
- "8080:8080"

View file

@ -100,18 +100,14 @@ func (s *Server) setupRoutes() {
r.Use(maxBodySizeMiddleware(1 << 20))
r.Get("/", s.handleIndex)
publicFS, err := fs.Sub(s.publicAssets, "public")
if err != nil {
s.logger.Error("Failed to create public assets sub-filesystem", "error", err)
} else {
r.Handle("/*", http.FileServer(http.FS(publicFS)))
}
integration.RegisterAll(s.integrations, r, s.cfg, s.store, s.logger, authMiddleware)
r.Get("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/favicon.webp", http.StatusMovedPermanently)
})
r.Get("/health", s.handleHealthCheck)
integration.RegisterAll(s.integrations, r, s.cfg, s.store, s.logger, authMiddleware)
r.With(authMiddleware(s.cfg.APIKey)).Get("/fragment/apps", s.handleFragmentApps)
r.With(authMiddleware(s.cfg.APIKey)).Get("/fragment/integrations", s.handleFragmentIntegrations)
@ -134,6 +130,13 @@ func (s *Server) setupRoutes() {
r.With(authMiddleware(s.cfg.APIKey)).Post("/{appName}", s.handleNtfyPublish)
publicFS, err := fs.Sub(s.publicAssets, "public")
if err != nil {
s.logger.Error("Failed to create public assets sub-filesystem", "error", err)
} else {
r.Handle("/*", http.FileServer(http.FS(publicFS)))
}
s.router = r
}