mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 08:43:10 -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:
|
||||
prism:
|
||||
container_name: prism
|
||||
image: ghcr.io/lone-cloud/prism:dev
|
||||
ports:
|
||||
- "8080:8080"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue