/* |-------------------------------------------------------------------------- | Environment variables service |-------------------------------------------------------------------------- | | The `Env.create` method creates an instance of the Env service. The | service validates the environment variables and also cast values | to JavaScript data types. | */ import { Env } from '@adonisjs/core/env' export default await Env.create(new URL('../', import.meta.url), { // Node NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const), PORT: Env.schema.number(), HOST: Env.schema.string({ format: 'host' }), LOG_LEVEL: Env.schema.string(), // App APP_KEY: Env.schema.secret(), APP_URL: Env.schema.string({ format: 'url', tld: false }), // Session SESSION_DRIVER: Env.schema.enum(['cookie', 'memory'] as const), // MongoDB MONGODB_URI: Env.schema.string(), MONGODB_DB_NAME: Env.schema.string.optional(), // Observability OTEL_EXPORTER_URI: Env.schema.string.optional(), OTEL_SAMPLER_MODE: Env.schema.string.optional(), OTEL_SAMPLER_RATIO: Env.schema.string.optional(), OTEL_SERVICE_NAME: Env.schema.string.optional(), // Remote logging LOG_HOST: Env.schema.string.optional(), LOG_PORT: Env.schema.number.optional(), LOG_PROTOCOL: Env.schema.string.optional(), // Security HASH_KEY: Env.schema.string.optional(), })