diff --git a/.env.example b/.env.example index 9d31fe83..3742bca1 100644 --- a/.env.example +++ b/.env.example @@ -14,7 +14,7 @@ NODE_ENV=development # Set to a randomly generated 16 bytes string SECRET_KEY=ChangeMeChangeMe -# URI of Mongo database that TellForm will connect to +# URI of Mongo database that TellForm will connect to #DO NOT CHANGE MONGODB_URI=mongodb://mongo/tellform @@ -121,4 +121,4 @@ APP_NAME= APP_KEYWORDS= # Set this to set the 'description' meta property in the HTML head -APP_DESC= \ No newline at end of file +APP_DESC= diff --git a/app.json b/app.json index 36ae03d7..b546c4f2 100644 --- a/app.json +++ b/app.json @@ -7,7 +7,7 @@ "addons": ["mongolab", "sendgrid", "heroku-redis"], "env": { "SUBDOMAINS_DISABLED": { - "description": "Disable support for running subdomains. (This should be true if you are not using your own custom domain.", + "description": "Disable support for running subdomains. (This should be true if you are not using your own custom domain.)", "value": "TRUE" }, "ENABLE_CLUSTER_MODE": { @@ -19,7 +19,8 @@ "value": "production" }, "BASE_URL": { - "description": "The url of your heroku app." + "description": "The url of your heroku app.", + "required": false }, "SOCKET_URL": { "description": "Where you websockets will connect to (i.e. your heroku app url)" diff --git a/gruntfile.js b/gruntfile.js index 0b5539b9..ccbfbef3 100755 --- a/gruntfile.js +++ b/gruntfile.js @@ -334,13 +334,14 @@ module.exports = function(grunt) { // Debug task. grunt.registerTask('debug', ['lint', 'html2js:main', 'html2js:forms', 'concurrent:debug']); - + // Lint task(s). grunt.registerTask('lint', ['jshint', 'csslint', 'i18nlint:client', 'i18nlint:server']); grunt.registerTask('lint:tests', ['jshint:allTests']); // Build task(s). grunt.registerTask('build', ['lint', 'loadConfig', 'cssmin', 'ngAnnotate', 'uglify', 'html2js:main', 'html2js:forms']); + grunt.registerTask('build:prod', ['loadConfig', 'cssmin', 'uglify', 'html2js:main', 'html2js:forms']); //Setup task(s). grunt.registerTask('setup', ['execute']); diff --git a/package.json b/package.json index 2372d3b0..4f0a2665 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,10 @@ "scripts": { "addcontrib": "all-contributors add", "generate": "all-contributors generate", - "start": "grunt", + "start": "node server.js", + "start:local": "grunt", "test": "grunt test", - "postinstall": "bower install --config.interactive=false", + "postinstall": "bower install --config.interactive=false && grunt build:prod", "init": "node scripts/setup.js" }, "dependencies": { @@ -47,8 +48,7 @@ "grunt-contrib-csslint": "~1.0.0", "grunt-contrib-cssmin": "~1.0.1", "grunt-contrib-jshint": "~1.0.0", - "grunt-contrib-uglify": "~0.11.0", - "grunt-contrib-watch": "~0.6.1", + "grunt-contrib-uglify": "~0.11.1", "grunt-env": "~0.4.1", "grunt-html2js": "^0.6.0", "grunt-ng-annotate": "~1.0.1", @@ -88,7 +88,7 @@ "grunt-closure-compiler": "0.0.21", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-copy": "^1.0.0", - "grunt-contrib-uglify": "^0.11.1", + "grunt-contrib-watch": "~0.6.1", "grunt-execute": "^0.2.2", "grunt-i18nlint": "github:jwarby/grunt-i18nlint", "grunt-karma": "~0.12.1", diff --git a/server.js b/server.js index 557f0d33..b55a4388 100755 --- a/server.js +++ b/server.js @@ -10,6 +10,10 @@ if(fs.existsSync(__dirname + '/.env')) { else { console.warn('unable to find .env file, expecting env vars'); } +// fix for heroku +process.env.MAILER_EMAIL_ID = process.env.MAILER_EMAIL_ID || process.env.SENDGRID_USERNAME; +process.env.MAILER_PASSWORD = process.env.MAILER_PASSWORD || process.env.SENDGRID_PASSWORD; + if(!process.env.NODE_ENV){ process.env.NODE_ENV = 'development';