vendure-config.hbs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. adminApiPath: 'admin-api',
  20. shopApiPath: 'shop-api',
  21. dbConnectionOptions: {
  22. type: '{{ dbType }}',
  23. {{#if requiresConnection}}
  24. synchronize: true, // turn this off for production
  25. {{else}}
  26. synchronize: false, // not working with SQLite/SQL.js, see https://github.com/typeorm/typeorm/issues/2576
  27. {{/if}}
  28. logging: false,
  29. database: {{#if isSQLjs}}new Uint8Array([]){{else}}'{{ normalizedDbName }}'{{/if}},
  30. {{#if isSQLjs}}
  31. location: '{{ normalizedDbName }}',
  32. autoSave: true,
  33. {{/if}}
  34. {{#if requiresConnection}}
  35. host: '{{ dbHost }}',
  36. port: {{ dbPort }},
  37. username: '{{ dbUserName }}',
  38. password: '{{ dbPassword }}',
  39. {{/if}}
  40. },
  41. paymentOptions: {
  42. paymentMethodHandlers: [examplePaymentHandler],
  43. },
  44. customFields: {},
  45. importExportOptions: {
  46. importAssetsDir: path.join(__dirname, 'vendure/import-assets'),
  47. },
  48. plugins: [
  49. new DefaultAssetServerPlugin({
  50. route: 'assets',
  51. assetUploadDir: path.join(__dirname, 'vendure/assets'),
  52. port: 3001,
  53. }),
  54. new DefaultEmailPlugin({
  55. templatePath: path.join(__dirname, 'vendure/email/templates'),
  56. devMode: true,
  57. templateVars: {
  58. shopUrl: 'http://www.example.com',
  59. }
  60. }),
  61. new DefaultSearchPlugin(),
  62. new AdminUiPlugin({ port: 3002 }),
  63. ],
  64. };
  65. {{#if isTs}}
  66. {{else}}
  67. module.exports = { config };
  68. {{/if}}