Explanation
Keep secrets out of git. Load PORT, DATABASE_URL, and AUTH_SECRET from environment variables.
Code example
typescriptconst port = Number(process.env.PORT ?? 4000);
const databaseUrl = process.env.DATABASE_URL;
if (!databaseUrl) throw new Error("DATABASE_URL is required");Helpful resources
Exercise
Add a .env.example file and fail startup if DATABASE_URL or AUTH_SECRET is missing.
