The backend for the project formerly known as signet, now known as beignet.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

22 rindas
367 B

  1. package endpoints
  2. import (
  3. "encoding/json"
  4. "net/http"
  5. . "github.com/imosed/signet/data"
  6. )
  7. func UsersExist(w http.ResponseWriter, _ *http.Request) {
  8. var numUsers int64
  9. Db.Table("users").Count(&numUsers)
  10. var resp SuccessResponse
  11. resp.Success = numUsers > 0
  12. err := json.NewEncoder(w).Encode(resp)
  13. if err != nil {
  14. panic("Could not deliver response")
  15. }
  16. }