Permalink
Browse files

Merge from gabrielmanchini - issue #50

  • Loading branch information...
1 parent 84874bc commit 014d941d6e9f8f47639c89bfecc24cf8601f0a28 @roieki roieki committed Sep 10, 2013
View
@@ -0,0 +1,41 @@
+// http://www.jshint.com/docs/
+{
+ "node": true, // Enable globals available when code is running inside of the NodeJS runtime environment.
+ "browser": true, // Standard browser globals e.g. `window`, `document`.
+ "es5": true, // Allow EcmaScript 5 syntax.
+ "esnext": true, // Allow ES.next specific features such as `const` and `let`.
+ "bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.).
+ "camelcase": false, // Permit only camelcase for `var` and `object indexes`.
+ "curly": false, // Require {} for every new block or scope.
+ "eqeqeq": true, // Require triple equals i.e. `===`.
+ "immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
+ "latedef": true, // Prohibit variable use before definition.
+ "newcap": true, // Require capitalization of all constructor functions e.g. `new F()`.
+ "noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`.
+ "quotmark": "single", // Define quotes to string values.
+ "regexp": true, // Prohibit `.` and `[^...]` in regular expressions.
+ "undef": true, // Require all non-global variables be declared before they are used.
+ "unused": true, // Warn unused variables.
+ "strict": false, // Require `use strict` pragma in every file.
+ "trailing": true, // Prohibit trailing whitespaces.
+ "smarttabs": false, // Suppresses warnings about mixed tabs and spaces
+ "globals": { // Globals variables.
+ "angular": false
+ },
+ "predef": [ // Extra globals.
+ "define",
+ "require",
+ "exports",
+ "module",
+ "describe",
+ "before",
+ "beforeEach",
+ "after",
+ "afterEach",
+ "it"
+ ],
+ "indent": 2, // Specify indentation spacing
+ "maxlen": 120, // Max line lenght
+ "devel": false, // Allow development statements e.g. `console.log();`.
+ "noempty": true // Prohibit use of empty blocks.
+}
View
@@ -0,0 +1 @@
+/test
View
@@ -1,3 +1,7 @@
language: node_js
node_js:
- - "0.10"
+ - "0.10"
+env:
+ - NODE_ENV=travis
+services:
+ - mongodb
View
@@ -0,0 +1,19 @@
+REPORTER = spec
+NODEARGS =
+test:
+# @./node_modules/grunt-contrib-jshint/node_modules/.bin/jshint ./**/*.js --config .jshintrc &2> /dev/null
+ @if [ ! -n "$(NODE_ENV)" ]; then NODE_ENV=test NODE_PATH=lib ./node_modules/grunt-nodemon/node_modules/.bin/nodemon -x ./node_modules/.bin/mocha -R $(REPORTER) -t 15000 --recursive test $(NODEARGS); else NODE_PATH=lib ./node_modules/.bin/mocha -R $(REPORTER) -t 15000 --recursive test $(NODEARGS); fi
+
+start:
+ @if [ ! -n "$(NODE_ENV)" ]; then NODE_ENV=development NODE_PATH=lib ./node_modules/grunt-nodemon/node_modules/.bin/nodemon server.js $(NODEARGS) ; else NODE_PATH=lib ./node_modules/.bin/foreman start; fi
+
+mocha:
+ NODE_PATH=lib ./node_modules/.bin/mocha -R $(REPORTER) -t 15000 --recursive test $(NODEARGS)
+
+repl:
+ @NODE_ENV=development NODE_PATH=lib node --debug $(NODEARGS)
+
+webtest:
+ @NODE_ENV=test NODE_PATH=lib ./node_modules/.bin/web-mocha test $(NODEARGS)
+
+.PHONY: jshint test repl webtest mocha
View
@@ -28,8 +28,10 @@ MEAN is a boilerplate that provides a nice starting point for [MongoDB](http://w
$ npm install
- We recommend using [Grunt](https://github.com/gruntjs/grunt-cli) to start the server:
+ Export the node Path to load your lib into project (default in HEROKU)
+ $ export NODE_PATH=lib
+ We recommend using [Grunt](https://github.com/gruntjs/grunt-cli) to start the server:
$ grunt
When not using grunt you can use:
@@ -2,8 +2,7 @@
* Module dependencies.
*/
var mongoose = require('mongoose'),
- env = process.env.NODE_ENV || 'development',
- config = require('../../config/config')[env],
+ config = require('../../config/config'),
Schema = mongoose.Schema;
View
@@ -1,86 +1,7 @@
-var path = require('path'),
- rootPath = path.normalize(__dirname + '/..');
+var _ = require('underscore');
-module.exports = {
- development: {
- db: 'mongodb://localhost/mean-dev',
- root: rootPath,
- app: {
- name: 'MEAN - A Modern Stack - Development'
- },
- facebook: {
- clientID: "APP_ID",
- clientSecret: "APP_SECRET",
- callbackURL: "http://localhost:3000/auth/facebook/callback"
- },
- twitter: {
- clientID: "CONSUMER_KEY",
- clientSecret: "CONSUMER_SECRET",
- callbackURL: "http://localhost:3000/auth/twitter/callback"
- },
- github: {
- clientID: 'APP_ID',
- clientSecret: 'APP_SECRET',
- callbackURL: 'http://localhost:3000/auth/github/callback'
- },
- google: {
- clientID: "APP_ID",
- clientSecret: "APP_SECRET",
- callbackURL: "http://localhost:3000/auth/google/callback"
- }
- },
- test: {
- db: 'mongodb://localhost/mean-test',
- root: rootPath,
- app: {
- name: 'MEAN - A Modern Stack - Test'
- },
- facebook: {
- clientID: "APP_ID",
- clientSecret: "APP_SECRET",
- callbackURL: "http://localhost:3000/auth/facebook/callback"
- },
- twitter: {
- clientID: "CONSUMER_KEY",
- clientSecret: "CONSUMER_SECRET",
- callbackURL: "http://localhost:3000/auth/twitter/callback"
- },
- github: {
- clientID: 'APP_ID',
- clientSecret: 'APP_SECRET',
- callbackURL: 'http://localhost:3000/auth/github/callback'
- },
- google: {
- clientID: "APP_ID",
- clientSecret: "APP_SECRET",
- callbackURL: "http://localhost:3000/auth/google/callback"
- }
- },
- production: {
- db: 'mongodb://localhost/mean',
- root: rootPath,
- app: {
- name: 'MEAN - A Modern Stack - Production'
- },
- facebook: {
- clientID: "APP_ID",
- clientSecret: "APP_SECRET",
- callbackURL: "http://localhost:3000/auth/facebook/callback"
- },
- twitter: {
- clientID: "CONSUMER_KEY",
- clientSecret: "CONSUMER_SECRET",
- callbackURL: "http://localhost:3000/auth/twitter/callback"
- },
- github: {
- clientID: 'APP_ID',
- clientSecret: 'APP_SECRET',
- callbackURL: 'http://localhost:3000/auth/github/callback'
- },
- google: {
- clientID: "APP_ID",
- clientSecret: "APP_SECRET",
- callbackURL: "http://localhost:3000/auth/google/callback"
- }
- }
-};
+// Load app configuration
+
+module.exports = _.extend(
+ require(__dirname + '/../config/env/all.js'),
+ require(__dirname + '/../config/env/' + process.env.NODE_ENV + '.json') || {}) ;
View
@@ -0,0 +1,8 @@
+var path = require('path'),
+rootPath = path.normalize(__dirname + '/../..');
+
+module.exports = {
+ root: rootPath,
+ port: process.env.PORT || 3000,
+ db: process.env.MONGOHQ_URL
+}
@@ -0,0 +1,26 @@
+{
+ "db": "mongodb://localhost/mean-dev",
+ "app": {
+ "name": "MEAN - A Modern Stack - Development"
+ },
+ "facebook": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/facebook/callback"
+ },
+ "twitter": {
+ "clientID": "CONSUMER_KEY",
+ "clientSecret": "CONSUMER_SECRET",
+ "callbackURL": "http://localhost:3000/auth/twitter/callback"
+ },
+ "github": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/github/callback"
+ },
+ "google": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/google/callback"
+ }
+}
@@ -0,0 +1,26 @@
+{
+ "db": "mongodb://localhost/mean",
+ "app": {
+ "name": "MEAN - A Modern Stack - Production"
+ },
+ "facebook": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/facebook/callback"
+ },
+ "twitter": {
+ "clientID": "CONSUMER_KEY",
+ "clientSecret": "CONSUMER_SECRET",
+ "callbackURL": "http://localhost:3000/auth/twitter/callback"
+ },
+ "github": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/github/callback"
+ },
+ "google": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/google/callback"
+ }
+}
View
@@ -0,0 +1,27 @@
+{
+ "db": "mongodb://localhost/mean-test",
+ "port": 3001,
+ "app": {
+ "name": "MEAN - A Modern Stack - Test"
+ },
+ "facebook": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/facebook/callback"
+ },
+ "twitter": {
+ "clientID": "CONSUMER_KEY",
+ "clientSecret": "CONSUMER_SECRET",
+ "callbackURL": "http://localhost:3000/auth/twitter/callback"
+ },
+ "github": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/github/callback"
+ },
+ "google": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/google/callback"
+ }
+}
@@ -0,0 +1,27 @@
+{
+ "db": "mongodb://localhost/mean-travis",
+ "port": 3001,
+ "app": {
+ "name": "MEAN - A Modern Stack - Test on travis"
+ },
+ "facebook": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/facebook/callback"
+ },
+ "twitter": {
+ "clientID": "CONSUMER_KEY",
+ "clientSecret": "CONSUMER_SECRET",
+ "callbackURL": "http://localhost:3000/auth/twitter/callback"
+ },
+ "github": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/github/callback"
+ },
+ "google": {
+ "clientID": "APP_ID",
+ "clientSecret": "APP_SECRET",
+ "callbackURL": "http://localhost:3000/auth/google/callback"
+ }
+}
View
@@ -4,9 +4,10 @@
var express = require('express'),
mongoStore = require('connect-mongo')(express),
flash = require('connect-flash'),
- helpers = require('view-helpers');
+ helpers = require('view-helpers'),
+ config = require('./config');
-module.exports = function(app, config, passport) {
+module.exports = function(app, passport) {
app.set('showStackError', true);
//Should be placed before express.static
View
@@ -3,11 +3,12 @@ var mongoose = require('mongoose'),
TwitterStrategy = require('passport-twitter').Strategy,
FacebookStrategy = require('passport-facebook').Strategy,
GitHubStrategy = require('passport-github').Strategy,
- GoogleStrategy = require('passport-google-oauth').OAuth2Strategy,
- User = mongoose.model('User');
+ GoogleStrategy = require('passport-google-oauth').Strategy,
+ User = mongoose.model('User'),
+ config = require('./config');
-module.exports = function(passport, config) {
+module.exports = function(passport) {
//Serialize sessions
passport.serializeUser(function(user, done) {
done(null, user.id);
@@ -142,8 +143,8 @@ module.exports = function(passport, config) {
//Use google strategy
passport.use(new GoogleStrategy({
- clientID: config.google.clientID,
- clientSecret: config.google.clientSecret,
+ consumerKey: config.google.clientID,
+ consumerSecret: config.google.clientSecret,
callbackURL: config.google.callbackURL
},
function(accessToken, refreshToken, profile, done) {
View
@@ -66,7 +66,7 @@ module.exports = function(grunt) {
},
exec: {
options: {
- exec: 'less'
+ exec: 'less'
}
}
},
Oops, something went wrong.

0 comments on commit 014d941

Please sign in to comment.