refactor: moved /status endpoint to always be public route

This commit is contained in:
David Allen 2024-12-03 11:55:53 -07:00 committed by Devon Bautista
parent b0b52dc432
commit ba3690cb5d
No known key found for this signature in database
GPG key ID: E1AAD3D4444A3DA0

View file

@ -116,7 +116,6 @@ func (s *Server) Serve() error {
// protected routes if using auth
r.HandleFunc("/generate", s.Generate(opts...))
r.HandleFunc("/status", s.GetStatus)
r.Post("/targets", s.createTarget)
})
} else {
@ -126,6 +125,7 @@ func (s *Server) Serve() error {
}
// always available public routes go here (none at the moment)
router.HandleFunc("/status", s.GetStatus)
s.Handler = router
return s.ListenAndServe()