Skip to content

Commit

Permalink
set up environment to run cleanly in cloud9 ide
Browse files Browse the repository at this point in the history
  • Loading branch information
btouellette committed Apr 3, 2014
1 parent 918113e commit 6916b8f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
Binary file modified .gitignore
Binary file not shown.
6 changes: 3 additions & 3 deletions config/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ module.exports = {
'facebookAuth' : {
'clientID' : '1388988078028764', // your App ID
'clientSecret' : process.env.FACEBOOK_SECRET, // your App Secret
'callbackURL' : 'http:https://localhost:' + (process.env.PORT || 8080) + '/auth/facebook/callback'
'callbackURL' : process.env.FACEBOOK_CALLBACK || 'http:https://localhost:' + (process.env.PORT || 8080) + '/auth/facebook/callback'
},

'twitterAuth' : {
'consumerKey' : '0P6wn4IB9MQSSt5eaF3eDxj1v',
'consumerSecret' : process.env.TWITTER_SECRET,
'callbackURL' : 'http:https://localhost:' + (process.env.PORT || 8080) + '/auth/twitter/callback'
'callbackURL' : process.env.TWITTER_CALLBACK || 'http:https://localhost:' + (process.env.PORT || 8080) + '/auth/twitter/callback'
},

'googleAuth' : {
'clientID' : '859053446273-1e5ln4ca5gco80tl88a0kefj35id3eik.apps.googleusercontent.com',
'clientSecret' : process.env.GOOGLE_SECRET,
'callbackURL' : 'http:https://localhost:' + (process.env.PORT || 8080) + '/auth/google/callback'
'callbackURL' : process.env.GOOGLE_CALLBACK || 'http:https://localhost:' + (process.env.PORT || 8080) + '/auth/google/callback'
}

};
11 changes: 11 additions & 0 deletions config/c9.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var argv = require('yargs').argv;

process.env.FACEBOOK_SECRET = argv.FACEBOOK_SECRET;
process.env.TWITTER_SECRET = argv.TWITTER_SECRET;
process.env.GOOGLE_SECRET = argv.GOOGLE_SECRET;

process.env.FACEBOOK_CALLBACK = 'https://concarneau-c9-btouellette.c9.io/auth/facebook/callback';
process.env.TWITTER_CALLBACK = 'https://concarneau-c9-btouellette.c9.io/auth/twitter/callback';
process.env.GOOGLE_CALLBACK = 'https://concarneau-c9-btouellette.c9.io/auth/google/callback';

process.env.MONGOLAB_URI = 'mongodb:https://' + process.env.IP + '/concarneau_db';
4 changes: 1 addition & 3 deletions config/database.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// config/database.js
module.exports = {

'url' : process.env.MONGOLAB_URI || 'mongodb:https://localhost/concarneau_db' // looks like mongodb:https://<user>:<pass>@mongo.onmodulus.net:27017/Mikha4ot

'url' : process.env.MONGOLAB_URI || 'mongodb:https://localhost/concarneau_db'
};
1 change: 1 addition & 0 deletions mongod_c9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"connect-flash": "~0.1.1",
"bcrypt-nodejs": "latest",
"tunnel": "0.0.3",
"socket.io": "^0.9.16"
"socket.io": "^0.9.16",
"yargs": "~1.2.1"
}
}
5 changes: 5 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if(process.env.HTTP_PROXY) {
require('./config/proxy.js')(host, port);
}

// if this is a c9 project configure appropriately
if(process.env.C9_PROJECT) {
require('./config/c9.js');
}

// get all the tools we need
var express = require('express');
var app = express();
Expand Down

0 comments on commit 6916b8f

Please sign in to comment.