Copied starter Meteor App files.

Cut and paste of the BasicMeteorApp.
This commit is contained in:
2018-07-30 14:15:39 -07:00
parent b65fc15fb8
commit 94000458e4
89 changed files with 27017 additions and 1 deletions

23
imports/api/index.js Normal file
View File

@@ -0,0 +1,23 @@
import Users from "./User.js";
import UserRoles from "./Roles.js";
//Save the collections in the Meteor.collections property for easy access without name conflicts.
Meteor.collections = {Users, UserRoles};
//If this is the server then setup the default admin user if none exist.
if(Meteor.isServer) {
//Change this to find admin users, create a default admin user if none exists.
if(Users.find({}).count() == 0) {
try {
console.log("Creating a default admin user: admin/admin");
let id = Accounts.createUser({password: 'admin', username: 'admin'});
//Requires the alanning:roles package.
Roles.addUsersToRoles(id, [Meteor.UserRoles.ROLE_MANAGE, Meteor.UserRoles.ROLE_UPDATE]);
}
catch(err) {
console.log(err);
}
}
}