I've lost count of how many times I've seen this in production:

const port = parseInt(process.env.PORT || "3000", 10)

const dbUrl = process.env.DATABASE_URL

if (!dbUrl) throw new Error("DATABASE_URL is required")

Enter fullscreen mode