Initial commit. Modified the Meteor todos app to create the Petit Teton data tracking app. Has working data for sales. Requires a Mongo database.
This commit is contained in:
12
imports/startup/server/email.js
Normal file
12
imports/startup/server/email.js
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
Accounts.emailTemplates.from = "Do Not Reply <administrator@declarativeengineering.com>";
|
||||
Accounts.emailTemplates.siteName = "Petit Teton App";
|
||||
// Accounts.emailTemplates.verifyEmail.subject = function (user) {
|
||||
// return "Welcome to My Site! Please verify your email";
|
||||
// };
|
||||
//
|
||||
// Accounts.emailTemplates.verifyEmail.html = function (user, url) {
|
||||
// return "Hi " + user.profile.firstName + " " + user.profile.lastName + ",\n\n" +
|
||||
// " Please verify your email by simply clicking the link below:\n\n" +
|
||||
// url;
|
||||
// };
|
||||
1
imports/startup/server/index.js
Normal file
1
imports/startup/server/index.js
Normal file
@@ -0,0 +1 @@
|
||||
import "./email.js"
|
||||
33
imports/startup/server/postStartup/version.js
Normal file
33
imports/startup/server/postStartup/version.js
Normal file
@@ -0,0 +1,33 @@
|
||||
let AppVersion = new Mongo.Collection('AppVersion');
|
||||
let AppVersionSchema = new SimpleSchema({
|
||||
version: {
|
||||
type: Number,
|
||||
optional: false,
|
||||
defaultValue: 0
|
||||
}
|
||||
});
|
||||
AppVersion.attachSchema(AppVersionSchema);
|
||||
|
||||
try {
|
||||
let appVersions = AppVersion.find({}).fetch();
|
||||
let appVersion;
|
||||
|
||||
if(!appVersions || appVersions.length == 0) { //This will happen only when first creating a database.
|
||||
appVersion = {version: 0};
|
||||
appVersion._id = AppVersion.insert(appVersion);
|
||||
}
|
||||
else if(appVersions.length > 1) { //This should never happen. Remove all but the first app version.
|
||||
for(let i = 1; i < appVersions.length; i++) {
|
||||
AppVersion.remove(appVersions[i]._id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
appVersion = appVersions[0];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch(err) {
|
||||
console.log("Caught an error while upgrading the app version: " + err);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user