I want to create an admin user if no users exist. I tried it on a js file inside the server folder
Meteor.startup(function () { if(!Meteor.users.find().count()
this way works for me:
var users=[ {email: "dgra@gmail.com", username: "gra", name: "gra", roles:['admin']} ]; _.each(users, function(user){ Accounts.createUser({ email: user.email, password: "admin", profile: {username: user.username}, profile: {name: user.name}, roles: user.roles }); });