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:
@@ -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
|
||||||
? {}
|
? {}
|
||||||
: {
|
: {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user