diff --git a/main.go b/main.go index a860c39..85d3aba 100644 --- a/main.go +++ b/main.go @@ -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)