Build HTTP APIs with routing, middleware, validation, controllers, and error handling.
Lessons
Send transactional email with Nodemailer.
Sending Email is easiest to learn by reading the example, changing it, and observing the result.
// npm install nodemailer
import nodemailer from 'nodemailer';
const transport = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: 587,
auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS }
});
await transport.sendMail({
from: '[email protected]',
to: '[email protected]',
subject: 'Welcome',
text: 'Thanks for signing up.'
});Practice the Sending Email example in a small scratch file, then explain what changed and why.