To run npm http-server with SSL, we create a certificate and use that to run the server.
To do this, we run
brew install mkcert
brew install nss
to install mkcert
Then we go to our project directory and run
mkcert 0.0.0.0 localhost 127.0.0.1 ::1
to create a certificate.
Then we run the server with our certificate with
http-server -S -C cert.pem -o