Skip to content

Commit

Permalink
Merge pull request #2 from andela/bg-resolve-nodemon-heroku-issues-15…
Browse files Browse the repository at this point in the history
…8749495

#158749495 Resolve Heroku and Nodemon Issues
  • Loading branch information
Oreofeoluwapo Ralph Olutola committed Jul 3, 2018
2 parents 6f8238c + f178cc0 commit d7bd8a0
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 59 deletions.
4 changes: 0 additions & 4 deletions .nodemonignore

This file was deleted.

8 changes: 5 additions & 3 deletions config/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
let _ = require('underscore');
/* eslint import/no-dynamic-require: 0 */ // --> OFF

const _ = require('underscore');

// Load app configuration
module.exports = _.extend(
require(`${__dirname }/../config/env/all.js`),
require(`${__dirname }/../config/env/${ process.env.NODE_ENV }.js`) || {}
require(`${__dirname}/../config/env/all.js`),
require(`${__dirname}/../config/env/${process.env.NODE_ENV}.js`),
);
50 changes: 25 additions & 25 deletions config/env/development.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module.exports = {
"app": {
"name": "Cards for Humanity - Development"
},
"port": 5000,
"MONGOHQ_URL": process.env.MONGOHQ_URL_DEV,
"facebook": {
"clientID": "APP_ID",
"clientSecret": "APP_SECRET",
"callbackURL": "http://cardsforhumanity.com:3000/auth/facebook/callback"
},
"twitter": {
"clientID": "CONSUMER_KEY",
"clientSecret": "CONSUMER_SECRET",
"callbackURL": "http://cardsforhumanity.com:3000/auth/twitter/callback"
},
"github": {
"clientID": "APP_ID",
"clientSecret": "APP_SECRET",
"callbackURL": "http://cardsforhumanity.com:3000/auth/github/callback"
},
"google": {
"clientID": "APP_ID",
"clientSecret": "APP_SECRET",
"callbackURL": "http://cardsforhumanity.com:3000/auth/google/callback"
}
app: {
name: 'Cards for Humanity - Development'
},
port: process.env.PORT,
MONGOHQ_URL: process.env.MONGOHQ_URL_DEV,
facebook: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://cardsforhumanity.com:3000/auth/facebook/callback'
},
twitter: {
clientID: 'CONSUMER_KEY',
clientSecret: 'CONSUMER_SECRET',
callbackURL: 'http://cardsforhumanity.com:3000/auth/twitter/callback'
},
github: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://cardsforhumanity.com:3000/auth/github/callback'
},
google: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://cardsforhumanity.com:3000/auth/google/callback'
}
};
47 changes: 24 additions & 23 deletions config/env/production.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
module.exports = {
"app": {
"name": "Cards for Humanity"
},
"facebook": {
"clientID": "APP_ID",
"clientSecret": "APP_SECRET",
"callbackURL": "http://cfh.io/auth/facebook/callback"
},
"twitter": {
"clientID": "CONSUMER_KEY",
"clientSecret": "CONSUMER_SECRET",
"callbackURL": "http://cfh.io/auth/twitter/callback"
},
"github": {
"clientID": "APP_ID",
"clientSecret": "APP_SECRET",
"callbackURL": "http://cfh.io/auth/github/callback"
},
"google": {
"clientID": "APP_ID",
"clientSecret": "APP_SECRET",
"callbackURL": "http://cfh.io/auth/google/callback"
}
app: {
name: 'Cards for Humanity'
},
MONGOHQ_URL: process.env.MONGOHQ_URL,
facebook: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://cfh.io/auth/facebook/callback'
},
twitter: {
clientID: 'CONSUMER_KEY',
clientSecret: 'CONSUMER_SECRET',
callbackURL: 'http://cfh.io/auth/twitter/callback'
},
github: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://cfh.io/auth/github/callback'
},
google: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://cfh.io/auth/google/callback'
}
};
4 changes: 2 additions & 2 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gulp.task('nodemon', () => {
nodemon({
verbose: true,
script: 'server.js',
ignore: ['README.md', 'node_modules/**', 'public/lib/**', '.DS_Store'],
ignore: ['README.md', 'node_modules/', '.DS_Store'],
ext: 'js html jade scss css',
watch: ['app', 'config', 'public', 'server.js'],
delayTime: 1,
Expand Down Expand Up @@ -54,7 +54,7 @@ gulp.task('export', () => {
});

// Default task(s).
gulp.task('default', ['export', 'nodemon', 'watch']);
gulp.task('default', ['nodemon', 'watch']);

// Backend Test task.
gulp.task('test:backend', shell.task([
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
},
"scripts": {
"start": "gulp",
"export": "gulp export",
"test": "export NODE_ENV=test || set NODE_ENV=test && gulp test",
"postinstall": "gulp install",
"postinstall": "gulp install && gulp export",
"build": "gulp build"
},
"nyc": {
Expand Down
1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const io = require('socket.io');

// Load configurations
// if test env, load example file

process.env.NODE_ENV = process.env.NODE_ENV || 'development';
const mongoose = require('mongoose');
const config = require('./config/config');
Expand Down

0 comments on commit d7bd8a0

Please sign in to comment.