Advertisement
aor88

Mean Instructions

Dec 11th, 2017
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. Installation
  2.  
  3. Install all dependencies in package.json file. This can be done by navigating to the root directory in the command prompt/terminal/console (I will refer to it as command prompt) and running the following command:
  4. $ npm install
  5. You must enter your own MongoDB configuration settings in the server.js file:
  6. mongoose.connect('mongodb://gugui3z24:password@ds055594.mlab.com:55594/diselfuel29', function(err) {
  7. if (err) {
  8. console.log('Not connected to the database: ' + err);
  9. } else {
  10. console.log('Successfully connected to MongoDB');
  11. }
  12. });
  13. You must enter your own Facebook, Twitter, and Google passport.js configuration settings in /app/passport/passport.js:
  14. passport.use(new FacebookStrategy({
  15. clientID: '', // Replace with your Facebook Developer App client ID
  16. clientSecret: '', // Replace with your Facebook Developer client secret
  17. callbackURL: "", // Replace with your Facebook Developer App callback URL
  18. profileFields: ['id', 'displayName', 'photos', 'email']
  19. }
  20. passport.use(new TwitterStrategy({
  21. consumerKey: '', // Replace with your Twitter Developer App consumer key
  22. consumerSecret: '', // Replace with your Twitter Developer App consumer secret
  23. callbackURL: "", // Replace with your Twitter Developer App callback URL
  24. userProfileURL: "https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true"
  25. }
  26. passport.use(new GoogleStrategy({
  27. clientID: '', // Replace with your Google Developer App client ID
  28. clientSecret: '', // Replace with your Google Developer App client ID
  29. callbackURL: "" // Replace with your Google Developer App callback URL
  30. }
  31. You must enter your own sendgrid e-mail information (found in api.js file):
  32. var options = {
  33. auth: {
  34. api_user: '', // Enter yourSendgrid username
  35. api_key: '' // Enter your Sendgrid password
  36. }
  37. };
  38. var client = nodemailer.createTransport(sgTransport(options));
  39. You must also update all e-mail callbacks (links that users click for e-mail activation/password reset, etc.) found in the api.js file:
  40. var email = {
  41. from: 'MEAN Stack Staff, staff@localhost.com',
  42. to: user.email,
  43. subject: 'Reset Password Request',
  44. text: 'Hello ' + user.name + ', You recently request a password reset link. Please click on the link below to reset your password:<br><br><a href="https://immense-dusk-71112.herokuapp.com/reset/' + user.resettoken,
  45. html: 'Hello<strong> ' + user.name + '</strong>,<br><br>You recently request a password reset link. Please click on the link below to reset your password:<br><br><a href="https://immense-dusk-71112.herokuapp.com/reset/' + user.resettoken + '">https://immense-dusk-71112.herokuapp.com/reset/</a>'
  46. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement