dev-config.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import { AdminUiPlugin } from '@vendure/admin-ui-plugin';
  2. import { AssetServerPlugin } from '@vendure/asset-server-plugin';
  3. import { ADMIN_API_PATH, API_PORT, SHOP_API_PATH } from '@vendure/common/lib/shared-constants';
  4. import { DefaultLogger, DefaultSearchPlugin, examplePaymentHandler, LogLevel, VendureConfig } from '@vendure/core';
  5. import { defaultEmailHandlers, EmailPlugin } from '@vendure/email-plugin';
  6. import path from 'path';
  7. /**
  8. * Config settings used during development
  9. */
  10. export const devConfig: VendureConfig = {
  11. authOptions: {
  12. disableAuth: false,
  13. sessionSecret: 'some-secret',
  14. requireVerification: true,
  15. },
  16. port: API_PORT,
  17. adminApiPath: ADMIN_API_PATH,
  18. shopApiPath: SHOP_API_PATH,
  19. dbConnectionOptions: {
  20. synchronize: false,
  21. logging: false,
  22. type: 'mysql',
  23. host: '192.168.99.100',
  24. port: 3306,
  25. username: 'root',
  26. password: '',
  27. database: 'vendure-dev',
  28. // type: 'sqlite',
  29. // database: path.join(__dirname, 'vendure.sqlite'),
  30. // type: 'postgres',
  31. // host: '127.0.0.1',
  32. // port: 5432,
  33. // username: 'postgres',
  34. // password: 'Be70',
  35. // database: 'vendure',
  36. },
  37. paymentOptions: {
  38. paymentMethodHandlers: [examplePaymentHandler],
  39. },
  40. customFields: {},
  41. logger: new DefaultLogger({ level: LogLevel.Debug }),
  42. importExportOptions: {
  43. importAssetsDir: path.join(__dirname, 'import-assets'),
  44. },
  45. plugins: [
  46. new AssetServerPlugin({
  47. route: 'assets',
  48. assetUploadDir: path.join(__dirname, 'assets'),
  49. port: 5002,
  50. }),
  51. new DefaultSearchPlugin(),
  52. new EmailPlugin({
  53. devMode: true,
  54. handlers: defaultEmailHandlers,
  55. templatePath: path.join(__dirname, '../email-plugin/templates'),
  56. outputPath: path.join(__dirname, 'test-emails'),
  57. mailboxPort: 5003,
  58. globalTemplateVars: {
  59. verifyEmailAddressUrl: 'http://localhost:4201/verify',
  60. passwordResetUrl: 'http://localhost:4201/reset-password',
  61. changeEmailAddressUrl: 'http://localhost:4201/change-email-address',
  62. },
  63. }),
  64. new AdminUiPlugin({
  65. port: 5001,
  66. }),
  67. ],
  68. };