Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/auth/commit/13b2037f32fb126a6c8a1575901d35522413cb33?style=unified&whitespace=show-all You should set ROOT_URL correctly, otherwise the web may not work correctly.

Добавил 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