fix(api): fall back to defaults when LOG_LEVEL or MAIL_FROM are empty

Compose defines unset optional variables as empty strings, so `??` kept
"" and Pino crashed on startup with an empty level, leaving the api
container unhealthy on Dokploy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jose Selesan
2026-10-19 09:41:53 -03:00
parent e0003490b3
commit 5a8604298e
2 changed files with 2 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ const isProduction = process.env.NODE_ENV === 'production'
* never use `console.log` in the backend. * never use `console.log` in the backend.
*/ */
export const logger = pino({ export const logger = pino({
level: process.env.LOG_LEVEL ?? (isProduction ? 'info' : 'debug'), level: process.env.LOG_LEVEL || (isProduction ? 'info' : 'debug'),
...(isProduction ...(isProduction
? {} ? {}
: { : {

View File

@@ -11,7 +11,7 @@ export type Email = {
} }
const apiKey = process.env.RESEND_API_KEY const apiKey = process.env.RESEND_API_KEY
const from = process.env.MAIL_FROM ?? 'Superlist <onboarding@resend.dev>' const from = process.env.MAIL_FROM || 'Superlist <onboarding@resend.dev>'
let client: Resend | null = null let client: Resend | null = null