The backend for the project formerly known as signet, now known as beignet.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

users.go 366 B

1234567891011121314151617181920
  1. package endpoints
  2. import (
  3. "encoding/json"
  4. . "github.com/imosed/signet/data"
  5. "net/http"
  6. )
  7. func UsersExist(w http.ResponseWriter, r *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. }