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()
I would suggest a /server/fixtures.js file. In this file, you can add your default user creation as such:
if ( Meteor.users.find().count() === 0 ) {
Accounts.createUser({
username: 'username',
email: 'email',
password: 'asdfasdf',
profile: {
first_name: 'fname',
last_name: 'lname',
company: 'company',
}
});
}