env.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. |--------------------------------------------------------------------------
  3. | Validating Environment Variables
  4. |--------------------------------------------------------------------------
  5. |
  6. | In this file we define the rules for validating environment variables.
  7. | By performing validation we ensure that your application is running in
  8. | a stable environment with correct configuration values.
  9. |
  10. | This file is read automatically by the framework during the boot lifecycle
  11. | and hence do not rename or move this file to a different location.
  12. |
  13. */
  14. import Env from '@ioc:Adonis/Core/Env'
  15. export default Env.rules({
  16. HOST: Env.schema.string({ format: 'host' }),
  17. PORT: Env.schema.number(),
  18. APP_KEY: Env.schema.string(),
  19. APP_NAME: Env.schema.string(),
  20. DRIVE_DISK: Env.schema.enum(['local', 's3'] as const),
  21. NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
  22. DB_CONNECTION: Env.schema.string(),
  23. MYSQL_HOST: Env.schema.string({ format: 'host' }),
  24. MYSQL_PORT: Env.schema.number(),
  25. MYSQL_USER: Env.schema.string(),
  26. MYSQL_PASSWORD: Env.schema.string(),
  27. MYSQL_DB_NAME: Env.schema.string(),
  28. S3_KEY: Env.schema.string(),
  29. S3_SECRET: Env.schema.string(),
  30. S3_BUCKET: Env.schema.string(),
  31. S3_REGION: Env.schema.string(),
  32. S3_ENDPOINT: Env.schema.string(),
  33. OSS_KEY: Env.schema.string(),
  34. OSS_SECRET: Env.schema.string(),
  35. OSS_REGION: Env.schema.string(),
  36. OSS_BUCKET: Env.schema.string(),
  37. OSS_ENDPOINT: Env.schema.string(),
  38. GOOGLE_CLIENT_ID: Env.schema.string(),
  39. GOOGLE_CLIENT_SECRET: Env.schema.string(),
  40. FACEBOOK_CLIENT_ID: Env.schema.string(),
  41. FACEBOOK_CLIENT_SECRET: Env.schema.string()
  42. })