1
0

vendure-config.hbs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {{#if isTs }}import{{ else }}const{{/if}} {
  2. dummyPaymentHandler,
  3. DefaultJobQueuePlugin,
  4. DefaultSearchPlugin,{{#if isTs}}
  5. VendureConfig,{{/if}}
  6. } {{#if isTs}}from '@vendure/core'; {{ else }}= require('@vendure/core');{{/if}}
  7. {{#if isTs }}
  8. import { defaultEmailHandlers, EmailPlugin } from '@vendure/email-plugin';
  9. {{ else }}
  10. const { defaultEmailHandlers, EmailPlugin } = require('@vendure/email-plugin');
  11. {{/if}}
  12. {{#if isTs }}
  13. import { AssetServerPlugin } from '@vendure/asset-server-plugin';
  14. {{ else }}
  15. const { AssetServerPlugin } = require('@vendure/asset-server-plugin');
  16. {{/if}}
  17. {{#if isTs }}
  18. import { AdminUiPlugin } from '@vendure/admin-ui-plugin';
  19. {{ else }}
  20. const { AdminUiPlugin } = require('@vendure/admin-ui-plugin');
  21. {{/if}}
  22. {{#if isTs }}
  23. import path from 'path';
  24. {{ else }}
  25. const path = require('path');
  26. {{/if}}
  27. {{#if isTs}}export {{/if}}const config{{#if isTs}}: VendureConfig{{/if}} = {
  28. apiOptions: {
  29. port: 3000,
  30. adminApiPath: 'admin-api',
  31. adminApiPlayground: {
  32. settings: {
  33. 'request.credentials': 'include',
  34. }{{#if isTs}} as any{{/if}},
  35. },// turn this off for production
  36. adminApiDebug: true, // turn this off for production
  37. shopApiPath: 'shop-api',
  38. shopApiPlayground: {
  39. settings: {
  40. 'request.credentials': 'include',
  41. }{{#if isTs}} as any{{/if}},
  42. },// turn this off for production
  43. shopApiDebug: true,// turn this off for production
  44. },
  45. authOptions: {
  46. superadminCredentials: {
  47. identifier: '{{ superadminIdentifier }}',
  48. password: '{{ superadminPassword }}',
  49. },
  50. },
  51. dbConnectionOptions: {
  52. type: '{{ dbType }}',
  53. {{#if requiresConnection}}
  54. synchronize: true, // turn this off for production
  55. {{else}}
  56. synchronize: false, // not working with SQLite/SQL.js, see https://github.com/typeorm/typeorm/issues/2576
  57. {{/if}}
  58. logging: false,
  59. database: {{#if isSQLjs}}new Uint8Array([]){{else if isSQLite}}path.join(__dirname, '../vendure.sqlite'){{else}}'{{ dbName }}'{{/if}},
  60. {{#if isSQLjs}}
  61. location: path.join(__dirname, 'vendure.sqlite'),
  62. autoSave: true,
  63. {{/if}}
  64. {{#if requiresConnection}}
  65. host: '{{ dbHost }}',
  66. port: {{ dbPort }},
  67. username: '{{ dbUserName }}',
  68. password: '{{ dbPassword }}',
  69. {{/if}}
  70. migrations: [path.join(__dirname, '../migrations/*.ts')],
  71. },
  72. paymentOptions: {
  73. paymentMethodHandlers: [dummyPaymentHandler],
  74. },
  75. customFields: {},
  76. plugins: [
  77. AssetServerPlugin.init({
  78. route: 'assets',
  79. assetUploadDir: path.join(__dirname, '../static/assets'),
  80. port: 3001,
  81. }),
  82. DefaultJobQueuePlugin,
  83. DefaultSearchPlugin,
  84. EmailPlugin.init({
  85. devMode: true,
  86. outputPath: path.join(__dirname, '../static/email/test-emails'),
  87. mailboxPort: 3003,
  88. handlers: defaultEmailHandlers,
  89. templatePath: path.join(__dirname, '../static/email/templates'),
  90. globalTemplateVars: {
  91. // The following variables will change depending on your storefront implementation
  92. fromAddress: '"example" <noreply@example.com>',
  93. verifyEmailAddressUrl: 'http://localhost:8080/verify',
  94. passwordResetUrl: 'http://localhost:8080/password-reset',
  95. changeEmailAddressUrl: 'http://localhost:8080/verify-email-address-change'
  96. },
  97. }),
  98. AdminUiPlugin.init({ port: 3002 }),
  99. ],
  100. };
  101. {{#if isTs}}
  102. {{else}}
  103. module.exports = { config };
  104. {{/if}}