Skip to content

Commit

Permalink
Merge pull request #20 from rohan-git/work-1-3
Browse files Browse the repository at this point in the history
Work 1 3
  • Loading branch information
rohan-git authored Dec 4, 2017
2 parents 5ddd958 + 7926178 commit e895e41
Show file tree
Hide file tree
Showing 9 changed files with 866 additions and 5 deletions.
204 changes: 204 additions & 0 deletions client/package-lock.json

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

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}
},
"dependencies": {
"localtunnel": "^1.8.3",
"react": "^16.1.1",
"react-dom": "^16.1.1",
"react-scripts": "1.0.17",
Expand Down
1 change: 1 addition & 0 deletions config/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
googleClientSecret: process.env.GOOGLE_CLIENT_SECRET,
mongoURI: process.env.MONGO_URI,
cookieKey: process.env.COOKIE_KEY,
redirectDomain: provess.env.REDIRECT_DOMAIN;
stripePublishableKey: process.env.STRIPE_PUBLISHABLE_KEY,
stripeSecretKey: process.env.STRIPE_SECRET_KEY,
sendGridKey: process.env.SENDGRID_KEY
Expand Down
18 changes: 17 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require('./models/Survey');
// services
require('./services/passport');

// user created
// user created
const keys = require('./config/keys');

console.log('mongo uri key --- ', keys.mongoURI);
Expand Down Expand Up @@ -46,6 +46,22 @@ require('./routes/authRoutes')(app);
require('./routes/billingRoutes')(app);
require('./routes/surveyRoutes')(app);

if(process.env.NODE_ENV === 'production'){

app.use(express.static('client/build'));

// Express serves production assets like main.js or main.css file.
// Express will serve indexhtml if it doesnt see ruote

const path = require('path');
app.get('*', (req, res) => {

res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'));

});

}

app.get('/', (req, resp) => {
resp.write("wee");
console.log('default route');
Expand Down
Loading

0 comments on commit e895e41

Please sign in to comment.