Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. const ENV = process.env.NODE_ENV || 'development'
  2.  
  3. /* DO NOT MODIFY THIS FILE!
  4. This is a template, make a copy and rename it to config.js
  5. */
  6.  
  7. /**
  8. * @typedef {Object} ConfigStore
  9. * @property {string} backendUrl
  10. * @property {string} frontendUrl
  11. * @property {number} expressPort Express Port Number
  12. * @property {string} mongoUri MongoDB Connect URI
  13. * @property {string} cookieSecret Secret for cookie validation
  14. * @property {Object} mailConfig Nodemailer Config
  15. * @property {string} mailSender Email sender
  16. * @property {boolean} skipEmailVerification
  17. * @property {boolean} useCors
  18. */
  19.  
  20. /** @type {ConfigStore} */
  21. const development = {
  22. backendUrl: 'http://localhost:3000',
  23. frontendUrl: 'http://localhost:8080',
  24. expressPort: 3000,
  25. mongoUri: 'mongodb+srv://tas:tas@cluster0-hh9pd.mongodb.net/tas?retryWrites=true&w=majority',
  26. cookieSecret: 'secret!',
  27. mailConfig: {
  28. service: 'gmail',
  29. auth: {
  30. user: 'epmailer0305',
  31. pass: 'zxvfkhkhzojoymrj'
  32. }
  33. },
  34. mailSender: 'Event Planner <eventplanner@restorn.ovh>',
  35. skipEmailVerification: true,
  36. useCors: true
  37. }
  38.  
  39. const configStore = {
  40. // production,
  41. // test,
  42. development
  43. }
  44.  
  45. /** @type {ConfigStore} */
  46. const selectedConfig = configStore[ENV]
  47. if (!selectedConfig) throw new Error(`Selected config ${ENV} does not exist`)
  48. Object.freeze(selectedConfig)
  49.  
  50. module.exports = selectedConfig
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement