diff --git a/config/env/all.js b/config/env/all.js index fd5c195c91..d35912d0f5 100644 --- a/config/env/all.js +++ b/config/env/all.js @@ -9,7 +9,6 @@ module.exports = { description: 'Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js', keywords: 'mongodb, express, angularjs, node.js, mongoose, passport' }, - root: rootPath, port: process.env.PORT || 3000, templateEngine: 'swig', sessionSecret: 'MEAN', @@ -20,13 +19,15 @@ module.exports = { 'public/lib/bootstrap/dist/css/bootstrap-theme.css', 'public/modules/**/css/*.css' ], - js: [ + lib: [ 'public/lib/angular/angular.js', 'public/lib/angular-resource/angular-resource.js', 'public/lib/angular-animate/angular-animate.js', 'public/lib/angular-ui-router/release/angular-ui-router.js', 'public/lib/angular-ui-utils/ui-utils.js', - 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js', + 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js' + ], + js: [ 'public/config.js', 'public/application.js', 'public/modules/*/*.js', @@ -37,4 +38,4 @@ module.exports = { 'public/modules/*/tests/*.js' ] } -}; \ No newline at end of file +}; diff --git a/config/env/development.js b/config/env/development.js index dc5837249b..43dc47d03e 100644 --- a/config/env/development.js +++ b/config/env/development.js @@ -6,23 +6,23 @@ module.exports = { title: 'MEAN.JS - Development Environment' }, facebook: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/facebook/callback' + clientID: process.env.FACEBOOK_ID || 'APP_ID', + clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET', + callbackPath: '/auth/facebook/callback' }, twitter: { - clientID: 'CONSUMER_KEY', - clientSecret: 'CONSUMER_SECRET', - callbackURL: 'http://localhost:3000/auth/twitter/callback' + clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY', + clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET', + callbackPath: '/auth/twitter/callback' }, google: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/google/callback' + clientID: process.env.GOOGLE_ID || 'APP_ID', + clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET', + callbackPath: '/auth/google/callback' }, linkedin: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/linkedin/callback' + clientID: process.env.LINKEDIN_ID || 'APP_ID', + clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET', + callbackPath: '/auth/linkedin/callback' } -}; \ No newline at end of file +}; diff --git a/config/env/production.js b/config/env/production.js index d3d54ae996..1f7c0168ae 100644 --- a/config/env/production.js +++ b/config/env/production.js @@ -7,23 +7,23 @@ module.exports = { js: 'public/dist/application.min.js' }, facebook: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/facebook/callback' + clientID: process.env.FACEBOOK_ID || 'APP_ID', + clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET', + callbackPath: '/auth/facebook/callback' }, twitter: { - clientID: 'CONSUMER_KEY', - clientSecret: 'CONSUMER_SECRET', - callbackURL: 'http://localhost:3000/auth/twitter/callback' + clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY', + clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET', + callbackPath: '/auth/twitter/callback' }, google: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/google/callback' + clientID: process.env.GOOGLE_ID || 'APP_ID', + clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET', + callbackPath: '/auth/google/callback' }, linkedin: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/linkedin/callback' + clientID: process.env.LINKEDIN_ID || 'APP_ID', + clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET', + callbackPath: '/auth/linkedin/callback' } -}; \ No newline at end of file +}; diff --git a/config/env/test.js b/config/env/test.js index a5a01a2998..a0f72fcb3a 100644 --- a/config/env/test.js +++ b/config/env/test.js @@ -7,23 +7,23 @@ module.exports = { title: 'MEAN.JS - Test Environment' }, facebook: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/facebook/callback' + clientID: process.env.FACEBOOK_ID || 'APP_ID', + clientSecret: process.env.FACEBOOK_SECRET || 'APP_SECRET', + callbackPath: '/auth/facebook/callback' }, twitter: { - clientID: 'CONSUMER_KEY', - clientSecret: 'CONSUMER_SECRET', - callbackURL: 'http://localhost:3000/auth/twitter/callback' + clientID: process.env.TWITTER_KEY || 'CONSUMER_KEY', + clientSecret: process.env.TWITTER_SECRET || 'CONSUMER_SECRET', + callbackPath: '/auth/twitter/callback' }, google: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/google/callback' + clientID: process.env.GOOGLE_ID || 'APP_ID', + clientSecret: process.env.GOOGLE_SECRET || 'APP_SECRET', + callbackPath: '/auth/google/callback' }, linkedin: { - clientID: 'APP_ID', - clientSecret: 'APP_SECRET', - callbackURL: 'http://localhost:3000/auth/linkedin/callback' + clientID: process.env.LINKEDIN_ID || 'APP_ID', + clientSecret: process.env.LINKEDIN_SECRET || 'APP_SECRET', + callbackPath: '/auth/linkedin/callback' } -}; \ No newline at end of file +}; diff --git a/config/express.js b/config/express.js index b5961e49ed..4ad2719bb5 100755 --- a/config/express.js +++ b/config/express.js @@ -129,4 +129,4 @@ module.exports = function(db) { }); return app; -}; \ No newline at end of file +}; diff --git a/config/strategies/facebook.js b/config/strategies/facebook.js index 037369968c..f435726514 100644 --- a/config/strategies/facebook.js +++ b/config/strategies/facebook.js @@ -1,6 +1,7 @@ 'use strict'; var passport = require('passport'), + url = require('url'), FacebookStrategy = require('passport-facebook').Strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); @@ -10,7 +11,7 @@ module.exports = function() { passport.use(new FacebookStrategy({ clientID: config.facebook.clientID, clientSecret: config.facebook.clientSecret, - callbackURL: config.facebook.callbackURL, + callbackURL: config.facebook.callbackPath, passReqToCallback: true }, function(req, accessToken, refreshToken, profile, done) { @@ -35,4 +36,4 @@ module.exports = function() { users.saveOAuthUserProfile(req, providerUserProfile, done); } )); -}; \ No newline at end of file +}; diff --git a/config/strategies/google.js b/config/strategies/google.js index 033e48e988..a27cc51e47 100644 --- a/config/strategies/google.js +++ b/config/strategies/google.js @@ -1,6 +1,7 @@ 'use strict'; var passport = require('passport'), + url = require('url'), GoogleStrategy = require('passport-google-oauth').OAuth2Strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); @@ -10,7 +11,7 @@ module.exports = function() { passport.use(new GoogleStrategy({ clientID: config.google.clientID, clientSecret: config.google.clientSecret, - callbackURL: config.google.callbackURL, + callbackURL: config.google.callbackPath, passReqToCallback: true }, function(req, accessToken, refreshToken, profile, done) { @@ -35,4 +36,4 @@ module.exports = function() { users.saveOAuthUserProfile(req, providerUserProfile, done); } )); -}; \ No newline at end of file +}; diff --git a/config/strategies/linkedin.js b/config/strategies/linkedin.js index f457e53aa5..2aa176b3b4 100644 --- a/config/strategies/linkedin.js +++ b/config/strategies/linkedin.js @@ -1,6 +1,7 @@ 'use strict'; var passport = require('passport'), + url = require('url'), LinkedInStrategy = require('passport-linkedin').Strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); @@ -10,7 +11,7 @@ module.exports = function() { passport.use(new LinkedInStrategy({ consumerKey: config.linkedin.clientID, consumerSecret: config.linkedin.clientSecret, - callbackURL: config.linkedin.callbackURL, + callbackURL: config.linkedin.callbackPath, passReqToCallback: true, profileFields: ['id', 'first-name', 'last-name', 'email-address'] }, @@ -36,4 +37,4 @@ module.exports = function() { users.saveOAuthUserProfile(req, providerUserProfile, done); } )); -}; \ No newline at end of file +}; diff --git a/config/strategies/twitter.js b/config/strategies/twitter.js index d772ba7638..b3df02d417 100644 --- a/config/strategies/twitter.js +++ b/config/strategies/twitter.js @@ -1,6 +1,7 @@ 'use strict'; var passport = require('passport'), + url = require('url'), TwitterStrategy = require('passport-twitter').Strategy, config = require('../config'), users = require('../../app/controllers/users.server.controller'); @@ -10,7 +11,7 @@ module.exports = function() { passport.use(new TwitterStrategy({ consumerKey: config.twitter.clientID, consumerSecret: config.twitter.clientSecret, - callbackURL: config.twitter.callbackURL, + callbackURL: config.twitter.callbackPath, passReqToCallback: true }, function(req, token, tokenSecret, profile, done) { @@ -32,4 +33,4 @@ module.exports = function() { users.saveOAuthUserProfile(req, providerUserProfile, done); } )); -}; \ No newline at end of file +}; diff --git a/gruntfile.js b/gruntfile.js index 18f746ce5c..448ff0ee95 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -122,6 +122,9 @@ module.exports = function(grunt) { //Build task(s). grunt.registerTask('build', ['jshint', 'csslint', 'uglify', 'cssmin']); + //Build task(s). + grunt.registerTask('heroku-deploy', ['jshint', 'csslint', 'uglify', 'cssmin']); + //Test task. grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']); }; \ No newline at end of file diff --git a/public/modules/articles/config/articles.client.routes.js b/public/modules/articles/config/articles.client.routes.js index 93f33d5b2b..d719e46c83 100755 --- a/public/modules/articles/config/articles.client.routes.js +++ b/public/modules/articles/config/articles.client.routes.js @@ -7,19 +7,19 @@ angular.module('articles').config(['$stateProvider', $stateProvider. state('listArticles', { url: '/articles', - templateUrl: 'modules/articles/views/list.articles.client.view.html' + templateUrl: 'modules/articles/views/list-articles.client.view.html' }). state('createArticle', { url: '/articles/create', - templateUrl: 'modules/articles/views/create.article.client.view.html' - }). + templateUrl: 'modules/articles/views/create-article.client.view.html' + }).ยง state('viewArticle', { url: '/articles/:articleId', - templateUrl: 'modules/articles/views/view.article.client.view.html' + templateUrl: 'modules/articles/views/view-article.client.view.html' }). state('editArticle', { url: '/articles/:articleId/edit', - templateUrl: 'modules/articles/views/edit.article.client.view.html' + templateUrl: 'modules/articles/views/edit-article.client.view.html' }); } ]); \ No newline at end of file diff --git a/public/modules/articles/views/create.article.client.view.html b/public/modules/articles/views/create-article.client.view.html similarity index 100% rename from public/modules/articles/views/create.article.client.view.html rename to public/modules/articles/views/create-article.client.view.html diff --git a/public/modules/articles/views/edit.article.client.view.html b/public/modules/articles/views/edit-article.client.view.html similarity index 100% rename from public/modules/articles/views/edit.article.client.view.html rename to public/modules/articles/views/edit-article.client.view.html diff --git a/public/modules/articles/views/list.articles.client.view.html b/public/modules/articles/views/list-articles.client.view.html similarity index 100% rename from public/modules/articles/views/list.articles.client.view.html rename to public/modules/articles/views/list-articles.client.view.html diff --git a/public/modules/articles/views/view.article.client.view.html b/public/modules/articles/views/view-article.client.view.html similarity index 100% rename from public/modules/articles/views/view.article.client.view.html rename to public/modules/articles/views/view-article.client.view.html diff --git a/public/modules/users/config/users.client.routes.js b/public/modules/users/config/users.client.routes.js index 24f60726eb..e715870ad4 100755 --- a/public/modules/users/config/users.client.routes.js +++ b/public/modules/users/config/users.client.routes.js @@ -7,15 +7,15 @@ angular.module('users').config(['$stateProvider', $stateProvider. state('profile', { url: '/settings/profile', - templateUrl: 'modules/users/views/settings/profile.client.view.html' + templateUrl: 'modules/users/views/settings/edit-profile.client.view.html' }). state('password', { url: '/settings/password', - templateUrl: 'modules/users/views/settings/password.client.view.html' + templateUrl: 'modules/users/views/settings/change-password.client.view.html' }). state('accounts', { url: '/settings/accounts', - templateUrl: 'modules/users/views/settings/accounts.client.view.html' + templateUrl: 'modules/users/views/settings/social-accounts.client.view.html' }). state('signup', { url: '/signup', diff --git a/public/modules/users/views/settings/password.client.view.html b/public/modules/users/views/settings/change-password.client.view.html similarity index 100% rename from public/modules/users/views/settings/password.client.view.html rename to public/modules/users/views/settings/change-password.client.view.html diff --git a/public/modules/users/views/settings/profile.client.view.html b/public/modules/users/views/settings/edit-profile.client.view.html similarity index 100% rename from public/modules/users/views/settings/profile.client.view.html rename to public/modules/users/views/settings/edit-profile.client.view.html diff --git a/public/modules/users/views/settings/accounts.client.view.html b/public/modules/users/views/settings/social-accounts.client.view.html similarity index 100% rename from public/modules/users/views/settings/accounts.client.view.html rename to public/modules/users/views/settings/social-accounts.client.view.html