Skip to content

Commit

Permalink
added new api command listUsers
Browse files Browse the repository at this point in the history
  • Loading branch information
believethehype committed Jun 12, 2023
1 parent 43e504d commit 00f7c5d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,20 @@ func main() {
},
)

router.Path("/api/listUsers/").HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {

var allusers []Params
allusers, err = GetAllUsers(s.Domain)

var result = ""
for _, user := range allusers {
result += user.Name + "@" + s.Domain + "\n"
}
fmt.Fprint(w, result)
},
)

api := router.PathPrefix("/api/v1").Subrouter()
api.Use(authenticate)

Expand Down

0 comments on commit 00f7c5d

Please sign in to comment.