Skip to content

Commit

Permalink
chore(env): properly define env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainLanz committed Dec 15, 2024
1 parent 47a1d49 commit 6064116
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/romainlanz.com/start/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ export default await Env.create(new URL('../', import.meta.url), {

// Mail
MAIL_DRIVER: Env.schema.enum(['smtp', 'brevo'] as const),
SMTP_HOST: Env.schema.string(),
SMTP_PORT: Env.schema.string(),
BREVO_API_KEY: Env.schema.string(),
...(process.env.NODE_ENV === 'production'
? {
BREVO_API_KEY: Env.schema.string(),
SMTP_HOST: Env.schema.string.optional(),
SMTP_PORT: Env.schema.string.optional(),
}
: {
BREVO_API_KEY: Env.schema.string.optional(),
SMTP_HOST: Env.schema.string(),
SMTP_PORT: Env.schema.string(),
}),
});

0 comments on commit 6064116

Please sign in to comment.