Добавил readiness api

main
slaventius 2 years ago
parent d52f1409aa
commit 13b2037f32
  1. 7
      internal/auth.go

@ -29,6 +29,7 @@ func NewServer(ctx context.Context, config *config.Config) *AuthServer {
}
//
s.Router.Get("/api/v1/ready", ready(s))
s.Router.Post("/api/v1/login", login(s))
s.Router.Post("/api/v1/registration", registration(s))
s.Router.Post("/api/v1/confirmation", confirmation(s))
@ -40,6 +41,12 @@ func (s *AuthServer) GracefulStop() error {
return s.db.Close()
}
func ready(s *AuthServer) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("ok"))
}
}
func login(s *AuthServer) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
uid := r.FormValue("uid")

Loading…
Cancel
Save