import '/imports/util/polyfills/regex.js';
import '/imports/startup/server';
import '/imports/startup/both';
import '/imports/api';
import '/imports/startup/server/postStartup/version.js';  //Run this right after the api - relies on the API to upgrade the app database & data to the current version.

let PropertiesReader = require('properties-reader');
let props = PropertiesReader('./assets/app/release.properties');

if(props.get('email-settings')) {
	process.env.MAIL_URL = props.get('email-settings');
	// console.log("Loaded email settings from properties file.");
}

if (!process.env.MAIL_URL) {
	process.env.MAIL_URL = Meteor.settings.MAIL_URL;
}

// console.log("Mail settings: " + process.env.MAIL_URL);

if(Meteor.log) Meteor.log.info("Server Started");
