npx serve dist -l 3000 --ssl-cert cert.pem --ssl-key key.pem

Category: Web App Development

npx serve dist -l 3000 --ssl-cert cert.pem --ssl-key key.pem

Serve a folder over HTTPS with a local certificate

Runs serve with TLS using a certificate and key pair, typically generated by mkcert so browsers trust the site without warnings. HTTPS matters when your app uses secure cookies or geolocation. Point a tunnel tool like ngrok at it to test over the public internet.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.