vendure-config.hbs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{#if isTs }}import{{ else }}const{{/if}} {
  2. AdminUiPlugin,
  3. examplePaymentHandler,
  4. DefaultAssetServerPlugin,
  5. DefaultEmailPlugin,
  6. DefaultSearchPlugin,
  7. {{#if isTs}}VendureConfig,{{/if}}
  8. } {{#if isTs}}from '@vendure/core'; {{ else }}= require('@vendure/core');{{/if}}
  9. {{#if isTs }}
  10. import * as path from 'path';
  11. {{ else }}
  12. const path = require('path');
  13. {{/if}}
  14. {{#if isTs}}export {{/if}}const config{{#if isTs}}: VendureConfig{{/if}} = {
  15. authOptions: {
  16. sessionSecret: '{{ sessionSecret }}',
  17. },
  18. port: 3000,
  19. apiPath: 'api',
  20. dbConnectionOptions: {
  21. type: '{{ dbType }}',
  22. {{#if requiresConnection}}
  23. synchronize: true, // turn this off for production
  24. {{else}}
  25. synchronize: false, // not working with SQLite/SQL.js, see https://github.com/typeorm/typeorm/issues/2576
  26. {{/if}}
  27. logging: false,
  28. database: {{#if isSQLjs}}new Uint8Array([]){{else}}'{{ normalizedDbName }}'{{/if}},
  29. {{#if isSQLjs}}
  30. location: '{{ normalizedDbName }}',
  31. autoSave: true,
  32. {{/if}}
  33. {{#if requiresConnection}}
  34. host: '{{ dbHost }}',
  35. port: {{ dbPort }},
  36. username: '{{ dbUserName }}',
  37. password: '{{ dbPassword }}',
  38. {{/if}}
  39. },
  40. paymentOptions: {
  41. paymentMethodHandlers: [examplePaymentHandler],
  42. },
  43. customFields: {},
  44. importExportOptions: {
  45. importAssetsDir: path.join(__dirname, 'vendure/import-assets'),
  46. },
  47. plugins: [
  48. new DefaultAssetServerPlugin({
  49. route: 'assets',
  50. assetUploadDir: path.join(__dirname, 'vendure/assets'),
  51. port: 3001,
  52. }),
  53. new DefaultEmailPlugin({
  54. templatePath: path.join(__dirname, 'vendure/email/templates'),
  55. devMode: true,
  56. }),
  57. new DefaultSearchPlugin(),
  58. new AdminUiPlugin({ port: 3002 }),
  59. ],
  60. };
  61. {{#if isTs}}
  62. {{else}}
  63. module.exports = { config };
  64. {{/if}}