mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 19:54:44 -07:00
fix health endpoint, nits
This commit is contained in:
parent
da4de081da
commit
b4205c5195
2 changed files with 13 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
services:
|
services:
|
||||||
prism:
|
prism:
|
||||||
|
container_name: prism
|
||||||
image: ghcr.io/lone-cloud/prism:dev
|
image: ghcr.io/lone-cloud/prism:dev
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
|
|
|
||||||
|
|
@ -100,18 +100,14 @@ func (s *Server) setupRoutes() {
|
||||||
r.Use(maxBodySizeMiddleware(1 << 20))
|
r.Use(maxBodySizeMiddleware(1 << 20))
|
||||||
|
|
||||||
r.Get("/", s.handleIndex)
|
r.Get("/", s.handleIndex)
|
||||||
|
r.Get("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
|
||||||
publicFS, err := fs.Sub(s.publicAssets, "public")
|
http.Redirect(w, r, "/favicon.webp", http.StatusMovedPermanently)
|
||||||
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("/health", s.handleHealthCheck)
|
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/apps", s.handleFragmentApps)
|
||||||
r.With(authMiddleware(s.cfg.APIKey)).Get("/fragment/integrations", s.handleFragmentIntegrations)
|
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)
|
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
|
s.router = r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue